jabenitez
(Jose Alberto Benítez)
July 15, 2017, 8:11pm
1
Hello. I have read this Home | Stardog Documentation Latest , and I have installed Stardog but I don't know how apply this.
I need next:
IF {
?p a :Person .
?q a :Person .
?p hasFriend ?q.
BIND (UUID() AS ?friendly) .
}
THEN {
?friendly a :Friendly .
?friendly isARelationWith ?q;
isARelationOfPerson ?p.
}
How I need to write it on stardog to run it? Is in SPARQL console?
Thanks!
stephen
(stephen)
July 17, 2017, 11:35am
2
Hi,
To use a Stardog Rule, simply insert the following RDF into the database (turtle, in this example):
@prefix rule: <tag:stardog:api:rule:> .
[] a rule:SPARQLRule ;
rule:content """
PREFIX :<urn:test:>
IF {...}
THEN {...}""" .
Once the database contains that information, running a query with reasoning enabled will use that rule as needed.
1 Like
You might want to go over the "Remarks " section under "New Individuals with SWRL". Specifically #2 or you might be surprised with the results from your rule.
Due to normalization, rules with more than one atom in the head are broken up into several rules.
2 Likes
system
(system)
Closed
July 31, 2017, 7:19pm
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.