Linking classes through property

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

Linking classes through property

OntoUser
I have an ontology (a taxonomy, with classes only; no individuals) like this:

    Owl:Thing
        Parts
            Jackfruit
            Jackfruit_flower
            Grape
        Plant
            Jackfruit_tree
            Grapevine

I want to create a relation to connect the two classes *Parts* and *Plant* :
*grows_in* which maps each part to a tree. Ultimately, I want to be able to
write SparQL queries, for example: Which parts *grow_in* specific plants.

I read somewhere that using an annotation property is the best way to go
about this. But, it seems like annotation properties don't work with
reasoners. It should be noted that the ontology I have is huge (>10,000
classes) and I'm using rdflib in python.

To link these classes, I created the annotation property *grows_in* with
Domain:*Parts* and Range:*Plants* in protege. Now, I'm able to run a SparQL
query that returns results appropriately. Also, in this case, the said
property (*grows_in*) should also inherit to subclasses and it turns out
that it's not possible with an annotation property.


So,

1. What is the right way to go about this?
2. How to make properties inherit across subclasses?

Thanks!



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Linking classes through property

Lorenz B.
Properties don't "connect" classes but individuals. At least for OWL
object properties. Clearly, you could go for OWL 2 Punning and use an
object property. Nevertheless, I don't know what you mean by reasoning.
Does rdflib support reasoning via SPARQL? What kind of reasoning do you
need? SPARQL is a query language for RDF, it'S pretty straithforward
since SPARQL 1.1, to query at least the simple rdfs:subClassOf based
class hierarchy by means of property paths (rdfs:subClassOf*)


On 18.06.2018 20:48, OntoUser wrote:

> I have an ontology (a taxonomy, with classes only; no individuals) like this:
>
>     Owl:Thing
>         Parts
>             Jackfruit
>             Jackfruit_flower
>             Grape
>         Plant
>             Jackfruit_tree
>             Grapevine
>
> I want to create a relation to connect the two classes *Parts* and *Plant* :
> *grows_in* which maps each part to a tree. Ultimately, I want to be able to
> write SparQL queries, for example: Which parts *grow_in* specific plants.
>
> I read somewhere that using an annotation property is the best way to go
> about this. But, it seems like annotation properties don't work with
> reasoners. It should be noted that the ontology I have is huge (>10,000
> classes) and I'm using rdflib in python.
>
> To link these classes, I created the annotation property *grows_in* with
> Domain:*Parts* and Range:*Plants* in protege. Now, I'm able to run a SparQL
> query that returns results appropriately. Also, in this case, the said
> property (*grows_in*) should also inherit to subclasses and it turns out
> that it's not possible with an annotation property.
>
>
> So,
>
> 1. What is the right way to go about this?
> 2. How to make properties inherit across subclasses?
>
> Thanks!
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Linking classes through property

OntoUser
Hi,

Thank you for getting back to me.

There are no individuals in my ontology, just classes. I've tried using an
annotation property for this and am able to run simple SparQL queries to
select triples with the *grows_in* property. But, I cannot use several
features of an object property (reflexivity, symmetry etc.) in an annotation
property.

 I see punning is the way forward to connect classes. But, what's the best
way to do it in protege?

I'm just using rdflib to populate the ontology from a text corpus.


Lorenz Buehmann wrote

> Properties don't "connect" classes but individuals. At least for OWL
> object properties. Clearly, you could go for OWL 2 Punning and use an
> object property. Nevertheless, I don't know what you mean by reasoning.
> Does rdflib support reasoning via SPARQL? What kind of reasoning do you
> need? SPARQL is a query language for RDF, it'S pretty straithforward
> since SPARQL 1.1, to query at least the simple rdfs:subClassOf based
> class hierarchy by means of property paths (rdfs:subClassOf*)
>
>
> On 18.06.2018 20:48, OntoUser wrote:
>> I have an ontology (a taxonomy, with classes only; no individuals) like
>> this:
>>
>>     Owl:Thing
>>         Parts
>>             Jackfruit
>>             Jackfruit_flower
>>             Grape
>>         Plant
>>             Jackfruit_tree
>>             Grapevine
>>
>> I want to create a relation to connect the two classes *Parts* and
>> *Plant* :
>> *grows_in* which maps each part to a tree. Ultimately, I want to be able
>> to
>> write SparQL queries, for example: Which parts *grow_in* specific plants.
>>
>> I read somewhere that using an annotation property is the best way to go
>> about this. But, it seems like annotation properties don't work with
>> reasoners. It should be noted that the ontology I have is huge (>10,000
>> classes) and I'm using rdflib in python.
>>
>> To link these classes, I created the annotation property *grows_in* with
>> Domain:*Parts* and Range:*Plants* in protege. Now, I'm able to run a
>> SparQL
>> query that returns results appropriately. Also, in this case, the said
>> property (*grows_in*) should also inherit to subclasses and it turns out
>> that it's not possible with an annotation property.
>>
>>
>> So,
>>
>> 1. What is the right way to go about this?
>> 2. How to make properties inherit across subclasses?
>>
>> Thanks!
>>
>>
>>
>> --
>> Sent from:
>> http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
>> _______________________________________________
>> protege-user mailing list
>>

> protege-user@.stanford

>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>
> _______________________________________________
> protege-user mailing list

> protege-user@.stanford

> https://mailman.stanford.edu/mailman/listinfo/protege-user





--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Linking classes through property

Lorenz B.
My question was, how do you run the SPARQL query?

And punning happens implicitly if you create an individual with the same
URI as the class has. Then you can use an object property to relate
those individuals


On 19.06.2018 11:01, OntoUser wrote:

> Hi,
>
> Thank you for getting back to me.
>
> There are no individuals in my ontology, just classes. I've tried using an
> annotation property for this and am able to run simple SparQL queries to
> select triples with the *grows_in* property. But, I cannot use several
> features of an object property (reflexivity, symmetry etc.) in an annotation
> property.
>
>  I see punning is the way forward to connect classes. But, what's the best
> way to do it in protege?
>
> I'm just using rdflib to populate the ontology from a text corpus.
>
>
> Lorenz Buehmann wrote
>> Properties don't "connect" classes but individuals. At least for OWL
>> object properties. Clearly, you could go for OWL 2 Punning and use an
>> object property. Nevertheless, I don't know what you mean by reasoning.
>> Does rdflib support reasoning via SPARQL? What kind of reasoning do you
>> need? SPARQL is a query language for RDF, it'S pretty straithforward
>> since SPARQL 1.1, to query at least the simple rdfs:subClassOf based
>> class hierarchy by means of property paths (rdfs:subClassOf*)
>>
>>
>> On 18.06.2018 20:48, OntoUser wrote:
>>> I have an ontology (a taxonomy, with classes only; no individuals) like
>>> this:
>>>
>>>     Owl:Thing
>>>         Parts
>>>             Jackfruit
>>>             Jackfruit_flower
>>>             Grape
>>>         Plant
>>>             Jackfruit_tree
>>>             Grapevine
>>>
>>> I want to create a relation to connect the two classes *Parts* and
>>> *Plant* :
>>> *grows_in* which maps each part to a tree. Ultimately, I want to be able
>>> to
>>> write SparQL queries, for example: Which parts *grow_in* specific plants.
>>>
>>> I read somewhere that using an annotation property is the best way to go
>>> about this. But, it seems like annotation properties don't work with
>>> reasoners. It should be noted that the ontology I have is huge (>10,000
>>> classes) and I'm using rdflib in python.
>>>
>>> To link these classes, I created the annotation property *grows_in* with
>>> Domain:*Parts* and Range:*Plants* in protege. Now, I'm able to run a
>>> SparQL
>>> query that returns results appropriately. Also, in this case, the said
>>> property (*grows_in*) should also inherit to subclasses and it turns out
>>> that it's not possible with an annotation property.
>>>
>>>
>>> So,
>>>
>>> 1. What is the right way to go about this?
>>> 2. How to make properties inherit across subclasses?
>>>
>>> Thanks!
>>>
>>>
>>>
>>> --
>>> Sent from:
>>> http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
>>> _______________________________________________
>>> protege-user mailing list
>>>
>> protege-user@.stanford
>>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>> _______________________________________________
>> protege-user mailing list
>> protege-user@.stanford
>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Linking classes through property

OntoUser
For my first version with just the annotation property grows_in, my SPARQL
query looked like this:

SELECT * WHERE {
  ?parts occursIn ?plant
}

and it worked.

I see punning is the way forward here to have object properties. Is there a
quick way to create individuals corresponding to each class, i.e, have
duplicate (in a sense) individual corresponding to a class so as to
establish a object property relationship?


I guess I'll have to refactor the ontology to accommodate this.


Lorenz Buehmann wrote

> My question was, how do you run the SPARQL query?
>
> And punning happens implicitly if you create an individual with the same
> URI as the class has. Then you can use an object property to relate
> those individuals
>
>
> On 19.06.2018 11:01, OntoUser wrote:
>> Hi,
>>
>> Thank you for getting back to me.
>>
>> There are no individuals in my ontology, just classes. I've tried using
>> an
>> annotation property for this and am able to run simple SparQL queries to
>> select triples with the *grows_in* property. But, I cannot use several
>> features of an object property (reflexivity, symmetry etc.) in an
>> annotation
>> property.
>>
>>  I see punning is the way forward to connect classes. But, what's the
>> best
>> way to do it in protege?
>>
>> I'm just using rdflib to populate the ontology from a text corpus.
>>
>>
>> Lorenz Buehmann wrote
>>> Properties don't "connect" classes but individuals. At least for OWL
>>> object properties. Clearly, you could go for OWL 2 Punning and use an
>>> object property. Nevertheless, I don't know what you mean by reasoning.
>>> Does rdflib support reasoning via SPARQL? What kind of reasoning do you
>>> need? SPARQL is a query language for RDF, it'S pretty straithforward
>>> since SPARQL 1.1, to query at least the simple rdfs:subClassOf based
>>> class hierarchy by means of property paths (rdfs:subClassOf*)
>>>
>>>
>>> On 18.06.2018 20:48, OntoUser wrote:
>>>> I have an ontology (a taxonomy, with classes only; no individuals) like
>>>> this:
>>>>
>>>>     Owl:Thing
>>>>         Parts
>>>>             Jackfruit
>>>>             Jackfruit_flower
>>>>             Grape
>>>>         Plant
>>>>             Jackfruit_tree
>>>>             Grapevine
>>>>
>>>> I want to create a relation to connect the two classes *Parts* and
>>>> *Plant* :
>>>> *grows_in* which maps each part to a tree. Ultimately, I want to be
>>>> able
>>>> to
>>>> write SparQL queries, for example: Which parts *grow_in* specific
>>>> plants.
>>>>
>>>> I read somewhere that using an annotation property is the best way to
>>>> go
>>>> about this. But, it seems like annotation properties don't work with
>>>> reasoners. It should be noted that the ontology I have is huge (>10,000
>>>> classes) and I'm using rdflib in python.
>>>>
>>>> To link these classes, I created the annotation property *grows_in*
>>>> with
>>>> Domain:*Parts* and Range:*Plants* in protege. Now, I'm able to run a
>>>> SparQL
>>>> query that returns results appropriately. Also, in this case, the said
>>>> property (*grows_in*) should also inherit to subclasses and it turns
>>>> out
>>>> that it's not possible with an annotation property.
>>>>
>>>>
>>>> So,
>>>>
>>>> 1. What is the right way to go about this?
>>>> 2. How to make properties inherit across subclasses?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from:
>>>> http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
>>>> _______________________________________________
>>>> protege-user mailing list
>>>>
>>> protege-user@.stanford
>>>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>>> _______________________________________________
>>> protege-user mailing list
>>> protege-user@.stanford
>>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>>
>>
>>
>>
>> --
>> Sent from:
>> http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
>> _______________________________________________
>> protege-user mailing list
>>

> protege-user@.stanford

>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>
> _______________________________________________
> protege-user mailing list

> protege-user@.stanford

> https://mailman.stanford.edu/mailman/listinfo/protege-user





--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user