On 10/07/14 15:33, Zahir Kali wrote:
Hello,
i am working about enrichment data with Jena general purpose rule engine, and i 
would add a new individual to the data.
Example:
I have data like this:
     <owl:NamedIndividual rdf:about="&data;serveur-106216">
     <data:heberge rdf:resource="&data;applications-105049"/>
<rdf:type rdf:resource="&data;serveur"/>
<data:identifiant-reseau 
rdf:datatype="&xsd;string">SRVLINMAGZ06</data:identifiant-reseau>
<status rdf:datatype="&xsd;string">En service</status>
<svr-numero-serie rdf:datatype="&xsd;string">-</svr-numero-serie>
<data:espacelibre rdf:datatype="&xsd;string>30</data:espacelibre>
     </owl:NamedIndividual>

  and i have a rule like this:

[Rule103_checkProdApplication:(?serv rdf:type data:serveur),
(?serv data:status 'En service'^^xsd:string)
-> (add new individual)]

Please, do you have an idea?

You create the resource for the new individual on the left hand side then on the right hand side assert the properties you want for it.

How you do this depends on what you want. If the new individual is going to be a URI resource then use uriConcat to create the relevant URI. If you want some arbitrary blank node then use makeTemp. If you want it to be a blank node but might have multiple rules asserting properties of that blank node then you use makeSkolem.

https://jena.apache.org/documentation/inference/#RULEbuiltins

Dave

Reply via email to