You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Evangelia Daskalaki <ev...@ics.forth.gr> on 2011/09/08 12:48:49 UTC
Read OWL Instances in form of rdf:Description question
Dear all,
I have an OWL file which I read by using the jena API.
At the moment I read all the Classes ( model.listClasses() ) , the
Objectproperties (model.listObjectProperties() ) , the
Datatypeproperties (model.listDatatypeProperties() ) and the Individuals
(model.listIndividuals()).
But the OWL file contains also Individuals expressed in the form of
rdf:Description:
Example:
<rdf:Description rdf:about="#7700574884352544358">
<hasDataValue rdf:datatype="&xsd;string">Rachel Rath</hasDataValue>
</rdf:Description>
How can I read these individuals?
Thank you in advance,
Eva
--
---------------------------------------------
Evangelia Daskalaki
Information System Laboratory
Institute of Computer Science
Foundation of Research& Technology
e-mail: eva@ics.forth.gr
Tel: 0030 2810391623
Ευαγγελία Δασκαλάκη
Εργαστήριο Πληροφοριακών Συστημάτων
Ινστιτούτο Πληροφορικής
Ίδρυμα Τεχνολογίας& Έρευνας
e-mail: eva@ics.forth.gr
Tηλ: 0030 2810391623
-----------------------------------------------
Before printing, think about the environment
-----------------------------------------------
Re: Read OWL Instances in form of rdf:Description question
Posted by Evangelia Daskalaki <ev...@ics.forth.gr>.
Thank you Dave for you corrections and the solutions you offered.
I have used the listStatements( null, EG.hasDataValue, (RDFNode)null)
and it works fine.
Kind Regards,
Eva
Στις 9/8/2011 7:52 PM, ο/η Dave Reynolds έγραψε:
> On Thu, 2011-09-08 at 13:48 +0300, Evangelia Daskalaki wrote:
>> Dear all,
>> I have an OWL file which I read by using the jena API.
>> At the moment I read all the Classes ( model.listClasses() ) , the
>> Objectproperties (model.listObjectProperties() ) , the
>> Datatypeproperties (model.listDatatypeProperties() ) and the Individuals
>> (model.listIndividuals()).
> [Probably just use of language but the "read" step is when you load the
> data into your Model. All those list* API calls are then queries onto
> that model, they aren't literally reading the file.]
>
>> But the OWL file contains also Individuals expressed in the form of
>> rdf:Description:
>>
>> Example:
>> <rdf:Description rdf:about="#7700574884352544358">
>> <hasDataValue rdf:datatype="&xsd;string">Rachel Rath</hasDataValue>
>> </rdf:Description>
>>
>> How can I read these individuals?
> Depends what it is about those that identify them.
>
> You could use:
>
> listSubjectsWithProperty( EG.hasDataValue )
>
> or (nearly equivalent)
>
> listStatements( null, EG.hasDataValue, (RDFNode)null)
>
> Alternatively if your ontology defines a domain for hasDataValue then
> you could turn on inference (OWLMicro) and those would then become
> identifiable as individuals.
>
> Dave
>
>
>
Re: Read OWL Instances in form of rdf:Description question
Posted by Dave Reynolds <da...@gmail.com>.
On Thu, 2011-09-08 at 13:48 +0300, Evangelia Daskalaki wrote:
> Dear all,
> I have an OWL file which I read by using the jena API.
> At the moment I read all the Classes ( model.listClasses() ) , the
> Objectproperties (model.listObjectProperties() ) , the
> Datatypeproperties (model.listDatatypeProperties() ) and the Individuals
> (model.listIndividuals()).
[Probably just use of language but the "read" step is when you load the
data into your Model. All those list* API calls are then queries onto
that model, they aren't literally reading the file.]
> But the OWL file contains also Individuals expressed in the form of
> rdf:Description:
>
> Example:
> <rdf:Description rdf:about="#7700574884352544358">
> <hasDataValue rdf:datatype="&xsd;string">Rachel Rath</hasDataValue>
> </rdf:Description>
>
> How can I read these individuals?
Depends what it is about those that identify them.
You could use:
listSubjectsWithProperty( EG.hasDataValue )
or (nearly equivalent)
listStatements( null, EG.hasDataValue, (RDFNode)null)
Alternatively if your ontology defines a domain for hasDataValue then
you could turn on inference (OWLMicro) and those would then become
identifiable as individuals.
Dave