What about using, list_subject then verify that if the subject is not
an action or a reified statement, then it has to be an object of a
property and for those who are subjects, they have to be one statement
only or one or two actions ???
There should be a way to constraint the content of an RDF file out of
the RDFS or all the contraint shall be expressed by the RDFS. For
instance because my RDF file express an the content of a message, then
maybe i shall have a RDFS that define what is a content element and
etc.... I 'm just asking.
On Aug 22, 2011, at 12:02 PM, Dave Reynolds wrote:
On 21/08/2011 19:19, Maatary Daniel OKOUYA wrote:
And Here is an example of an actual RDF file representing a message
based on the application independent and specific ontology mentioned
above. It represent a promise content message send from an Agent to
another.
<!DOCTYPErdf:RDF[<!ENTITYxsd"http://www.w3.org/2001/XMLSchema#">]>
<rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ocean="http://www.people.lu.unisi.ch/fornaran/schemas/ocean-rdf0#
"
xmlns:app="http://www.people.lu.unisi.ch/fornaran/schemas/app-rdf0#"
xml:base="http://www.people.lu.unisi.ch/fornaran/example/promise">
<app:Payrdf:ID="JohnAction1">
<ocean:hasActor>John</ocean:hasActor>
<ocean:hasDuration>2</ocean:hasDuration>
<app:hasRecipient>Mary</app:hasRecipient>
<app:hasAmount>5</app:hasAmount>
</app:Pay>
<app:Deliverrdf:ID="MaryAction1">
<ocean:hasActor>Mary</ocean:hasActor>
<app:hasRecipient>John</app:hasRecipient>
<app:hasObject>book1</app:hasObject>
</app:Deliver>
</rdf:RDF>
[Snip]
I need to parse this late file, distinduishingm what is an action, a
predicate and a concept/object (which can not be a content on its
won as
explain above). The main issue here comes between differentiating
between action and concept.
Don't know what you mean by concept here but, for example, to find
all Actions then create a model which contains you base data and
your ontology and query it for patterns of the form:
?a rdf:type [ rdfs:subClassOf eg:Action]
Then for each Action resource you find you can list its properties
using Resource.listProperties.
Basically i have my ontology programatically available while parsing
that file. So base on the name of the tag or the type if the
RDFdescription for is used, i can find out if its correspond to an
action or a know concept. But the thing is, it could be malformed.
I need to check that if i have 2 outmost node then they both are
action.
if i have a an action and an object/concept, then this object/
concept is
the definition of the object specify in the property of the resource.
Don't think in terms of the RDF/XML syntax, do think about tags and
XML tree structure. There are so many ways that the same RDF model
can be serialized in XML that anything like that will be fragile.
The point of Jena is that it allows you to parse the file into a
Model and work on that data using the Model API and/or SPARQL
queries - the XML syntax is not relevant.
Dave