onto.individuals() looking for individuals in imported ontologies

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

onto.individuals() looking for individuals in imported ontologies

gp
This post was updated on .
[ edited subject following a conversation with Jiba]

Hello Jean-Baptiste,

It seems to me like the method .individuals is forgetting about some individuals, namely those whose label have a type (xsd:string).
This looks like a similar problem as the one where entities with some localisation entry would be ignored.

I sit on some development version from bitbucket, 1 or 2 weeks old.

Cheers,
Guillaume

Reply | Threaded
Open this post in threaded view
|

Re: onto.individuals() ignoring individuals with some label which have a type?

Jiba
Administrator
Hello,

I tested it with a very simple ontology (see below), but I am unable to reproduce your problem.

Could you send me an example?

Best regards,
Jiba

---8<-------------

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>

<rdf:RDF xmlns="http://www.semanticweb.org/jiba/ontologies/2018/5/untitled-ontology-79#"
     xml:base="http://www.semanticweb.org/jiba/ontologies/2018/5/untitled-ontology-79"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <owl:Ontology rdf:about="http://www.semanticweb.org/jiba/ontologies/2018/5/untitled-ontology-79"/>

    <owl:Class rdf:about="http://www.semanticweb.org/jiba/ontologies/2018/5/untitled-ontology-79#C"/>

    <owl:NamedIndividual rdf:about="http://www.semanticweb.org/jiba/ontologies/2018/5/untitled-ontology-79#i">
        <rdf:type rdf:resource="http://www.semanticweb.org/jiba/ontologies/2018/5/untitled-ontology-79#C"/>
        <rdfs:label rdf:datatype="&xsd;string">Test</rdfs:label>
    </owl:NamedIndividual>
</rdf:RDF>

gp
Reply | Threaded
Open this post in threaded view
|

Re: onto.individuals() ignoring individuals with some label which have a type?

gp
This is a message documenting some direct discussion with Jiba.

Basically there is no problem with the label type.

The explaination  is the following:
The method onto.individuals only returns instances of the loaded ontology.

To get individuals defined in some imported ontology, this ontology must be loaded and searched directly.
i.e.
imported_onto = get_ontology("some onto").load()
imported_onto.individuals() # generator for the imported ontology.

This is the case even in the case of individuals created with the same iri as the original class in the imported ontology (puning) and which were defined in the higher ontology (importing other ontologies).


An interesting alternative is to use the World ontology. ie.
default_world.individuals() #this is a generator with all entities


Jiba I hope I did understand correctly and you can confirm.

Reply | Threaded
Open this post in threaded view
|

Re: onto.individuals() ignoring individuals with some label which have a type?

Jiba
Administrator
Thank you GP !

The individual is considered as defined in the ontology which include the following RDF triple: (individual_IRI, rdf:type, owl:NamedIndividual).