Skip to content

Commit

Permalink
adding RDF Surfaces support
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Mar 15, 2024
1 parent 63d033b commit 32f8eaf
Show file tree
Hide file tree
Showing 31 changed files with 396 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.5.0
60 changes: 60 additions & 0 deletions lingua/beetle.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# --------------
# Beetle example
# --------------
#
# See https://en.wikipedia.org/wiki/Disjunction_elimination

@prefix blogic: <http://www.w3.org/2000/10/swap/blogic#>.
@prefix : <#>.

# beetle is a car
:beetle a :Car.

# all cars are green or blue
(_:A) blogic:onNegativeSurface _:ns1.

_:ns1 {
_:A a :Car.
() blogic:onNegativeSurface _:ns2.
() blogic:onNegativeSurface _:ns3.
}

_:ns2 {
_:A :is :green.
}

_:ns3 {
_:A :is :blue.
}

# green things are beautiful
(_:A) blogic:onNegativeSurface _:ns4.

_:ns4 {
_:A :is :green.
() blogic:onNegativeSurface _:ns5.
}

_:ns5 {
_:A :is :beautiful.
}

# blue things are beautiful
(_:A) blogic:onNegativeSurface _:ns6.

_:ns6 {
_:A :is :blue.
() blogic:onNegativeSurface _:ns7.
}

_:ns7 {
_:A :is :beautiful.
}


# query
(_:S _:O) blogic:onQuerySurface _:qs.

_:qs {
_:S :is _:O.
}
32 changes: 32 additions & 0 deletions lingua/blogic.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ------------------
# Socrates inference
# ------------------
#
# Infer that Socrates is mortal.

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix blogic: <http://www.w3.org/2000/10/swap/blogic#>.
@prefix : <#>.

:Socrates a :Man.
:Man rdfs:subClassOf :Human.
:Human rdfs:subClassOf :Mortal.

(_:A _:B _:S) blogic:onNegativeSurface _:subclass_surface1.

_:subclass_surface1 {
_:A rdfs:subClassOf _:B.
_:S a _:A.
() blogic:onNegativeSurface _:subclass_surface2.
}

_:subclass_surface2 {
_:S a _:B.
}

# query
(_:S _:C) blogic:onQuerySurface _:query_surface.

_:query_surface {
_:S a _:C.
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions lingua/output/beetle.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix : <https://eyereasoner.github.io/see-lingua/lingua/beetle.trig#>.

:beetle :is :beautiful.
5 changes: 5 additions & 0 deletions lingua/output/blogic.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@prefix : <https://eyereasoner.github.io/see-lingua/lingua/blogic.trig#>.

:Socrates a :Man.
:Socrates a :Human.
:Socrates a :Mortal.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lingua/test
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ for file in *.trig
do
echo -en "$(pad "${file}" -24)"
start=$(($(date +%s%N)/1000000))
see --genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/see-lingua .. https://eyereasoner.github.io/see-lingua/lingua/$file --output proof/$file
see --genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/see-lingua .. https://eyereasoner.github.io/see-lingua/lingua/$file --output output/$file
end=$(($(date +%s%N)/1000000))
echo -en "${YELLOW}$(pad "`expr $end - $start` msec" 12)${NORMAL} "
if [[ $(git diff */$file | wc -l) -eq 0 ]]; then
Expand Down
Loading

0 comments on commit 32f8eaf

Please sign in to comment.