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/06/08 19:53:35 UTC

RE: Enrichment question

All,

First of all, thank you for your help (and patience)!

I also realized that I have a mismatch between between F as a literal and
ns:F as a resource. Now I have extended the file "test.xml" (see attachment)
with:

<rdfs:Class rdf:ID="Female">
<rdfs:subClassOf rdf:resource="#Individual"/>
<rdfs:subClassOf>
<daml:Restriction>
<daml:onProperty rdf:resource="#Sex"/>
<daml:hasValue rdf:resource="F"/>
</daml:Restriction>
</rdfs:subClassOf>
</rdfs:Class>

According to me, now I don’t have the mismatch right? (All that remains is
that I am still using DAML)

Best regards,

Paul Akkermans

-----Oorspronkelijk bericht-----
Van: Dave Reynolds [mailto:dave.e.reynolds@gmail.com] 
Verzonden: dinsdag 31 mei 2016 9:31
Aan: users@jena.apache.org
Onderwerp: Re: Enrichment question

Hi Paul,

This still seems to be DAML and still has a mismatch between F as a 
literal and ns:F as a resource.

See: http://markmail.org/message/leny7trglpc5qjt6

Did you send the right attachment? (There's only one)

Dave

On 30/05/16 21:00, Paul Akkermans wrote:
> All,
>
> I tried to resolve all tips and tricks and it still does not work. I have
> included the files as attachment. The Java code now looks like the
> following:
> public static void main(String args[])
>   {
>       Model schema = FileManager.get().loadModel("file:c://test.xml");
>       Model data = FileManager.get().loadModel("file:c://royal92.xml");
>       Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
>       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);
> }
>
> I would expect that my reasoner would pare the a:sex="F" and it should
> contain the property rdf:type with concept Female.
>
> Can somebody point me in the right direction?
>
> Thanks in advance.
>
>
> -----Oorspronkelijk bericht-----
> Van: Lorenz B. [mailto:buehmann@informatik.uni-leipzig.de]
> Verzonden: maandag 23 mei 2016 8:37
> Aan: users@jena.apache.org
> Onderwerp: Re: Enrichment question
>
> 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 Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2016.0.7597 / Virusdatabase: 4568/12278 - datum van uitgifte:
> 05/22/16
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2016.0.7597 / Virusdatabase: 4568/12278 - datum van uitgifte:
> 05/22/16
>


-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 2016.0.7598 / Virusdatabase: 4591/12329 - datum van uitgifte:
05/30/16

-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 2016.0.7598 / Virusdatabase: 4591/12329 - datum van uitgifte:
05/30/16

Re: Enrichment question

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

On 08/06/16 20:53, Paul Akkermans wrote:
> All,
>
> First of all, thank you for your help (and patience)!
>
> I also realized that I have a mismatch between between F as a literal and
> ns:F as a resource. Now I have extended the file "test.xml" (see attachment)
> with:
>
> <rdfs:Class rdf:ID="Female">
> <rdfs:subClassOf rdf:resource="#Individual"/>
> <rdfs:subClassOf>
> <daml:Restriction>
> <daml:onProperty rdf:resource="#Sex"/>
> <daml:hasValue rdf:resource="F"/>
> </daml:Restriction>
> </rdfs:subClassOf>
> </rdfs:Class>
>
> According to me, now I dont have the mismatch right?

Hard to tell. It's now a resource but from that attachment I can't tell 
if it's the right resource. The lack of # is suspicious but more 
seriously it's a relative URI so it depends on where you load the file from.

>(All that remains is
> that I am still using DAML)

Which, as already mentioned, has been obsolete for years and there's no 
support in jena for inference over it.

Dave

> -----Oorspronkelijk bericht-----
> Van: Dave Reynolds [mailto:dave.e.reynolds@gmail.com]
> Verzonden: dinsdag 31 mei 2016 9:31
> Aan: users@jena.apache.org
> Onderwerp: Re: Enrichment question
>
> Hi Paul,
>
> This still seems to be DAML and still has a mismatch between F as a
> literal and ns:F as a resource.
>
> See: http://markmail.org/message/leny7trglpc5qjt6
>
> Did you send the right attachment? (There's only one)
>
> Dave
>
> On 30/05/16 21:00, Paul Akkermans wrote:
>> All,
>>
>> I tried to resolve all tips and tricks and it still does not work. I have
>> included the files as attachment. The Java code now looks like the
>> following:
>> public static void main(String args[])
>>    {
>>        Model schema = FileManager.get().loadModel("file:c://test.xml");
>>        Model data = FileManager.get().loadModel("file:c://royal92.xml");
>>        Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
>>        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);
>> }
>>
>> I would expect that my reasoner would pare the a:sex="F" and it should
>> contain the property rdf:type with concept Female.
>>
>> Can somebody point me in the right direction?
>>
>> Thanks in advance.
>>
>>
>> -----Oorspronkelijk bericht-----
>> Van: Lorenz B. [mailto:buehmann@informatik.uni-leipzig.de]
>> Verzonden: maandag 23 mei 2016 8:37
>> Aan: users@jena.apache.org
>> Onderwerp: Re: Enrichment question
>>
>> 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
>>
>>
>>
>> -----
>> Geen virus gevonden in dit bericht.
>> Gecontroleerd door AVG - www.avg.com
>> Versie: 2016.0.7597 / Virusdatabase: 4568/12278 - datum van uitgifte:
>> 05/22/16
>>
>> -----
>> Geen virus gevonden in dit bericht.
>> Gecontroleerd door AVG - www.avg.com
>> Versie: 2016.0.7597 / Virusdatabase: 4568/12278 - datum van uitgifte:
>> 05/22/16
>>
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2016.0.7598 / Virusdatabase: 4591/12329 - datum van uitgifte:
> 05/30/16
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2016.0.7598 / Virusdatabase: 4591/12329 - datum van uitgifte:
> 05/30/16
>