Skip to content

Commit

Permalink
adding graph:term built-in
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Sep 2, 2024
1 parent e504421 commit 1b3fa00
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.1
1.4.2
22 changes: 20 additions & 2 deletions cases/output/socrates.trig
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
PREFIX : <https://eyereasoner.github.io/lingua/cases/socrates.trig#>
PREFIX graph: <http://www.w3.org/2000/10/swap/graph#>
PREFIX var: <http://www.w3.org/2000/10/swap/var#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

:Socrates a :Mortal.
_:node_1_1 graph:term _:node_1_1.
_:node_1_1 graph:member _:bng_1.
_:node_4_1 graph:term _:node_4_1.
_:node_4_1 graph:member _:node_4_1.

GRAPH _:node_1_1 {
var:A rdfs:subClassOf var:B.
var:S a var:A.
}

GRAPH _:bng_1 {
var:A rdfs:subClassOf var:B.
}

GRAPH _:node_4_1 {
var:X rdfs:subClassOf var:Y.
}
8 changes: 7 additions & 1 deletion cases/socrates.trig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Infer that Socrates is mortal.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX graph: <http://www.w3.org/2000/10/swap/graph#>
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX var: <http://www.w3.org/2000/10/swap/var#>
PREFIX : <#>
Expand All @@ -29,5 +30,10 @@ GRAPH _:bng_2 {
_:bng_3 log:query _:bng_3.

GRAPH _:bng_3 {
var:S a :Mortal.
var:S graph:term var:O.
var:O graph:member _:bng_4.
}

GRAPH _:bng_4 {
var:X rdfs:subClassOf var:Y.
}
8 changes: 4 additions & 4 deletions lingua.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('lingua v1.4.1').
version_info('lingua v1.4.2').

help_info('Usage: lingua <options>* <data>*

Expand Down Expand Up @@ -265,9 +265,6 @@
% remove rdf reifiers
retractall('<http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies>'(_, _)),

% remove rdf named graphs
retractall(graph(_, _)),

% create forward rules
assertz(implies((
'<http://www.w3.org/2000/10/swap/log#implies>'(A, B),
Expand Down Expand Up @@ -1417,6 +1414,9 @@
)
).

'<http://www.w3.org/2000/10/swap/graph#term>'(A, B) :-
graph(A, B).

'<http://www.w3.org/2000/10/swap/graph#union>'(A, B) :-
when(
( nonvar(A)
Expand Down

0 comments on commit 1b3fa00

Please sign in to comment.