You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Paul Akkermans <pa...@ziggo.nl> on 2016/05/22 19:56:24 UTC

Enrichment question

All,

 

I am trying to semantically enrich the following snippet:

<a:Individual rdf:about="#@I661@"

a:sex="F"

</a:Individual>

 

I tried to do it the following way:

<rdfs:Class rdf:ID="Individual">

<rdfs:comment> An individual named in a GEDCOM file. </rdfs:comment>

<rdfs:subClassOf>

<daml:Restriction>

<daml:onProperty rdf:resource="#sex"/>

<daml:toClass rdf:resource="http://www.w3.org/2000/10/XMLSchema#string"/>

</daml:Restriction>

</rdfs:subClassOf>

<rdfs:subClassOf>

<daml:Restriction>

<daml:onProperty rdf:resource="#sex"/>

<daml:hasValue rdf:resource="F"/>

</daml:Restriction>

</rdfs:subClassOf>

 

For some reason, when a run the program(see below) I don't get to see that
#@ I661@ is of type female

Can somebody help me out (or direct me to an example) how to enrich
a:sex="F" in such a way that the program recognizes F is of type Female?

 

Best regards,

 

Paul Akkermans

 

The program:

Model schema = FileManager.get().loadModel("file:c://test.xml");

Model data = FileManager.get().loadModel("file:c://royal92.xml");

Reasoner reasoner = ReasonerRegistry.getOWLReasoner();

reasoner = reasoner.bindSchema(schema);

InfModel infmodel = ModelFactory.createInfModel(reasoner, data);

     

Resource nForce =
infmodel.getResource("http://www.daml.org/2001/01/gedcom/royal92#@I661@");

printStatements(infmodel, nForce, null, null);

 


Re: Enrichment question

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Hello Paul,

off-topic, but don't write RDF/XML by hand. Use TURTLE or N-TRIPLES instead.

@topic: Try to list all individuals first, maybe you took the wrong 
namespace. It's not clear from the snippet you showed us in the 
beginning what prefix a: is defined as.

Kind regards,
Lorenz

> All,
>
>   
>
> I am trying to semantically enrich the following snippet:
>
> <a:Individual rdf:about="#@I661@"
>
> a:sex="F"
>
> </a:Individual>
>
>   
>
> I tried to do it the following way:
>
> <rdfs:Class rdf:ID="Individual">
>
> <rdfs:comment> An individual named in a GEDCOM file. </rdfs:comment>
>
> <rdfs:subClassOf>
>
> <daml:Restriction>
>
> <daml:onProperty rdf:resource="#sex"/>
>
> <daml:toClass rdf:resource="http://www.w3.org/2000/10/XMLSchema#string"/>
>
> </daml:Restriction>
>
> </rdfs:subClassOf>
>
> <rdfs:subClassOf>
>
> <daml:Restriction>
>
> <daml:onProperty rdf:resource="#sex"/>
>
> <daml:hasValue rdf:resource="F"/>
>
> </daml:Restriction>
>
> </rdfs:subClassOf>
>
>   
>
> For some reason, when a run the program(see below) I don't get to see that
> #@ I661@ is of type female
>
> Can somebody help me out (or direct me to an example) how to enrich
> a:sex="F" in such a way that the program recognizes F is of type Female?
>
>   
>
> Best regards,
>
>   
>
> Paul Akkermans
>
>   
>
> The program:
>
> Model schema = FileManager.get().loadModel("file:c://test.xml");
>
> Model data = FileManager.get().loadModel("file:c://royal92.xml");
>
> Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
>
> reasoner = reasoner.bindSchema(schema);
>
> InfModel infmodel = ModelFactory.createInfModel(reasoner, data);
>
>       
>
> Resource nForce =
> infmodel.getResource("http://www.daml.org/2001/01/gedcom/royal92#@I661@");
>
> printStatements(infmodel, nForce, null, null);
>
>   
>
>
-- 
Lorenz Bhmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: Enrichment question

Posted by Dave Reynolds <da...@gmail.com>.
Hi,

On 22/05/16 20:56, Paul Akkermans wrote:
> All,
>
>
>
> I am trying to semantically enrich the following snippet:
>
> <a:Individual rdf:about="#@I661@"
>
> a:sex="F"
>
> </a:Individual>

Note that the value of a:sex is a literal (a String), at least if I'm 
remembering my RDF/XML right. Re-serialize as Turtle to check.

> I tried to do it the following way:
>
> <rdfs:Class rdf:ID="Individual">
>
> <rdfs:comment> An individual named in a GEDCOM file. </rdfs:comment>
>
> <rdfs:subClassOf>
>
> <daml:Restriction>
>
> <daml:onProperty rdf:resource="#sex"/>
>
> <daml:toClass rdf:resource="http://www.w3.org/2000/10/XMLSchema#string"/>
>
> </daml:Restriction>
>
> </rdfs:subClassOf>
>
> <rdfs:subClassOf>
>
> <daml:Restriction>
>
> <daml:onProperty rdf:resource="#sex"/>
>
> <daml:hasValue rdf:resource="F"/>
>
> </daml:Restriction>
>
> </rdfs:subClassOf>

A few problems with that.

Firstly, it's not OWL so there's nothing for an OWL reasoner to do 
anything with. It think DAML is pretty much deprecated these days, 
certainly Jena no longer supports it.

Secondly, if you transpose it to OWL then make sure the value you give 
to the hasValue statement is a literal to match your data. Your example 
gives it as a Resource (the URI will be relative to the file from which 
you loaded that ontology).

Dave