All;
Regardless of access to SPIN explanations, a more general alternative
is to make provenance part of rule design. I.e. one can embed
provenance information in a rule. Reification can help in this case.
In the attached, file I have modified the kennedysSPIN model to create
a reified statement to each rule. This statement provides a string
that I have attached a timestemp and an explanation of where it came
from. This is done for the age rule:
CONSTRUCT {
?this :age ?age .
_:b0 a rdf:Statement .
_:b0 rdf:subject ?this .
_:b0 rdf:predicate :age .
_:b0 rdf:object ?age .
_:b0 rdfs:label ?rlabel .
}
WHERE {
?this kennedys:birthYear ?birthYear .
LET (?currentYear := :getCurrentYear()) .
LET (?age := (?currentYear - ?birthYear)) .
LET (?rlabel := smf:buildString("From kennedys:Person 'age' rule,
created on: {?1}", afn:now())) .
}
After running inferences, one can then query for the generated label
containing that information, such as:
SELECT DISTINCT ?person ?age ?rlabel
WHERE {
?person :age ?age .
?stmt rdf:object ?age .
?stmt rdfs:label ?rlabel .
}
One trick to note is that I have designed this using a subPropertyOf
spin:rule (named spin:reifiedRule) with rulePropertyMaxIterationCount
set to 1. This is because creating new triples in spin:rule will
trigger running the rule again, as is expected for forward-chaining
rules. But in this case I am creating triples that are a side-effect
of any rule chaining, and therefore do not want to trigger running the
rule again.
Of course, there are as many variations of this theme are there are
ways in which people will want to track provenance, and has tradeoffs
such as the overhead required to reify triples. But this provide a
very flexible way for doing things such a provenance.
-- Scott
On 4/5/10 8:00 AM, Arthur Keen wrote:
Holger,
Thanks. I could not find any explicit links or any queries that
retrieved the explanation, so I thought I would better to ask before
diving into the Java code. I have the same rationale as Tim for
looking into this - Traceability/provenance and perhaps for doing JTMS.
Arthur
On Apr 5, 2010, at 7:23 AM, Tim Darr wrote:
Something like this would be useful for
representing provenance. For example, I may have some concepts or
instances that are derived from external sources (manuals, books,
published literature, etc), and these concepts or instances are in turn
used to derive new instances. I may want to be able to query for the
provenances of the derived instance all the way back to the external
source.
On Mon, Apr 5, 2010 at 1:20 AM, Holger
Knublauch <[email protected]>
wrote:
Hi
Arthur,
the explanations are currently only accessible via Java code, either
from a TopBraid plugin or through the (open source) SPIN API directly.
If you are a programmer, look at
org.topbraid.spin.inference.SPINInferences.java.
How would you like to query those inferences - I presume via another
SPARQL query? Then what would you want to do with the results? They are
really just a map from triples to query strings right now.
Regards,
Holger
On Apr 5, 2010, at 2:10 PM, Arthur Keen wrote:
> Composer provides a way to look at the "explanation" for a
property inferred by a spin rule. How are the explanations
represented? Can I retrieve them with queries?
>
> Thanks
> Arthur
>
> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid
Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-composer-users?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid
Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
--
Tim Darr
[email protected]
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid
Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid
Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
To unsubscribe, reply using "remove me" as the subject.
|