Grouping Instances under One Class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Grouping Instances under One Class

Avraheem
Hello,

I have the following instances that are related to request1:

<VAL rdf:about="#val1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqVAL rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqVAL>
</VAL>

<REQ_SID rdf:about="#sid1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqSID rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqSID>
</REQ_SID>

<REQ_ADDR rdf:about="#addr1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</REQ_ADDR>

<REQ_NUM rdf:about="#num1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqNUM rdf:datatype="http://www.w3.org/2001/XMLSchema#string">00</reqNUM>
</REQ_NUM>

<REQ_DATA rdf:about="#data1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqDATA rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqDATA>
</REQ_DATA>

<REQ_BC rdf:about="#bc1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqBC rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqBC>
</REQ_BC>

<RequestData rdf:about="#request1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <hasReqBC rdf:resource="#bc1"/>
  <hasReqDATA rdf:resource="#data1"/>
  <hasReqSID rdf:resource="#sid1"/>
  <hasReqVAL rdf:resource="#val1"/>
</RequestData>

But what I want is to add those under the same request1 as:

<rdf:Description rdf:about="#request1">
<VAL rdf:about="#val1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqVAL rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqVAL>
</VAL>

<REQ_SID rdf:about="#sid1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqSID rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqSID>
</REQ_SID>

<REQ_ADDR rdf:about="#addr1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</REQ_ADDR>

<REQ_NUM rdf:about="#num1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqNUM rdf:datatype="http://www.w3.org/2001/XMLSchema#string">00</reqNUM>
</REQ_NUM>

<REQ_DATA rdf:about="#data1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqDATA rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqDATA>
</REQ_DATA>

<REQ_BC rdf:about="#bc1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <reqBC rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqBC>
</REQ_BC>
</rdf:Description>

The values that should be hexadecimal are stored as strings in the RDF triples:

<reqBC rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0xff</reqBC>

How I can store them as hexadecimal values using owlready?

Is there any advantage of storing the triples between <rdf:Description rdf:about="#request1">...</rdf:Description>? I guess there is no difference in terms of accessing the triples, is not it?
Reply | Threaded
Open this post in threaded view
|

Re: Grouping Instances under One Class

Jiba
Administrator
Fox hexadecimal values, you can find a recipe here:

http://owlready.8326.n8.nabble.com/Assign-missing-datatypes-td1845.html#a1850

Regarding the organization of RDF triples, I think there is no difference -- but keep in mind that Owlready automatically serialize to RDF but offer no control on the serialization, so you cannot choose one format: you'll have do accept the format it produce (it is the first one if I remember well).

Jiba