SPARQL-DL API: ObjectPropery of a class: Tbox query

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

SPARQL-DL API: ObjectPropery of a class: Tbox query

betafish
Hi,

I have been trying to use SPARQL-DL API [1] for querying my OWL2 file. What I'm trying to do it to look for ObjectProperty between two classes i.e. (if [object property exist bw these two classes] then [execute rule X])  
--------------------------------
OWL2 file snippet:

<owl:ObjectProperty rdf:ID="isManagedBy">
          <rdf:type rdf:resource="owl#FunctionalProperty" />
            <rdfs:domain rdf:resource="#FunctionManagement" />
            <rdfs:range rdf:resource="#SymposiumPlanner2013"/>
  </owl:ObjectProperty>

--------------------------
processQuery(
                                "PREFIX : <http://ibis.in.tum.de/projects/paw#>\n"
                                + "SELECT ?x ?y WHERE {\n" +
                                            "PropertyValue(?x,:isManagedBy, ?y)" +
                                        "}"
                                );

Error: Given entity in first argument of atom PropertyValue() is not an individual.
--------------------------------


[1]:http://www.derivo.de/en/resources/sparql-dl-api/sparql-dl-examples.html
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL-DL API: ObjectPropery of a class: Tbox query

Matthew Horridge-2
Administrator
Hi,

ObjectProperties don’t hold between classes.  They hold between individuals.  This is why you get the error message, "Given entity in first argument of atom PropertyValue() is not an Individual”.  

It looks like what you really want to do is something like,


SELECT ?d ?p ?r WHERE {
        ?p rdf:type owl:ObjectProperty .
        ?d rdf:type owl:Class .
        ?p rdfs:domain ?d
}

However, I don’t believe this is supported by SPARQL-DL (or at least this particular implementation).

You can get the domains of a property using a DL query.  Asking for the superclasses of "isManagedBy some Thing” will give you the domains of isManagedBy.  

You can get the ranges of a property using a DL query.  Asking for the superclasses of "inverse(isManagedBy) some Thing” will give you the ranges of isManagedBy.

Cheers,

Matthew




On 15 Apr 2014, at 02:23, betafish <[hidden email]> wrote:

> Hi,
>
> I have been trying to use SPARQL-DL API [1] for querying my OWL2 file. What
> I'm trying to do it to look for ObjectProperty between two classes i.e. (if
> [object property exist bw these two classes] then [execute rule X])  
> --------------------------------
> OWL2 file snippet:
>
> <owl:ObjectProperty rdf:ID="isManagedBy">
>  <rdf:type rdf:resource="owl#FunctionalProperty" />
>    <rdfs:domain rdf:resource="#FunctionManagement" />
>    <rdfs:range rdf:resource="#SymposiumPlanner2013"/>
> </owl:ObjectProperty>
>
> --------------------------
> processQuery(
> "PREFIX : <http://ibis.in.tum.de/projects/paw#>\n"
> + "SELECT ?x ?y WHERE {\n" +
>    "PropertyValue(?x,:isManagedBy, ?y)" +
> "}"
> );
>
> Error: Given entity in first argument of atom PropertyValue() is not an
> individual.
> --------------------------------
>
>
> [1]:http://www.derivo.de/en/resources/sparql-dl-api/sparql-dl-examples.html
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/SPARQL-DL-API-ObjectPropery-of-a-class-Tbox-query-tp4660228.html
> Sent from the Protege User mailing list archive at Nabble.com.
> _______________________________________________
> 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: SPARQL-DL API: ObjectPropery of a class: Tbox query

lesego phoshane

Hi,

Pls remove me from your mail list. I don't use protege anymore.

Thanx

On 15 Apr 2014 09:25, "Matthew Horridge" <[hidden email]> wrote:
Hi,

ObjectProperties don’t hold between classes.  They hold between individuals.  This is why you get the error message, "Given entity in first argument of atom PropertyValue() is not an Individual”.

It looks like what you really want to do is something like,


SELECT ?d ?p ?r WHERE {
        ?p rdf:type owl:ObjectProperty .
        ?d rdf:type owl:Class .
        ?p rdfs:domain ?d
}

However, I don’t believe this is supported by SPARQL-DL (or at least this particular implementation).

You can get the domains of a property using a DL query.  Asking for the superclasses of "isManagedBy some Thing” will give you the domains of isManagedBy.

You can get the ranges of a property using a DL query.  Asking for the superclasses of "inverse(isManagedBy) some Thing” will give you the ranges of isManagedBy.

Cheers,

Matthew




On 15 Apr 2014, at 02:23, betafish <[hidden email]> wrote:

> Hi,
>
> I have been trying to use SPARQL-DL API [1] for querying my OWL2 file. What
> I'm trying to do it to look for ObjectProperty between two classes i.e. (if
> [object property exist bw these two classes] then [execute rule X])
> --------------------------------
> OWL2 file snippet:
>
> <owl:ObjectProperty rdf:ID="isManagedBy">
>         <rdf:type rdf:resource="owl#FunctionalProperty" />
>           <rdfs:domain rdf:resource="#FunctionManagement" />
>           <rdfs:range rdf:resource="#SymposiumPlanner2013"/>
>       </owl:ObjectProperty>
>
> --------------------------
> processQuery(
>                               "PREFIX : <http://ibis.in.tum.de/projects/paw#>\n"
>                               + "SELECT ?x ?y WHERE {\n" +
>                                           "PropertyValue(?x,:isManagedBy, ?y)" +
>                                       "}"
>                               );
>
> Error: Given entity in first argument of atom PropertyValue() is not an
> individual.
> --------------------------------
>
>
> [1]:http://www.derivo.de/en/resources/sparql-dl-api/sparql-dl-examples.html
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/SPARQL-DL-API-ObjectPropery-of-a-class-Tbox-query-tp4660228.html
> Sent from the Protege User mailing list archive at Nabble.com.
> _______________________________________________
> 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

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

Re: SPARQL-DL API: ObjectPropery of a class: Tbox query

lesego phoshane
In reply to this post by betafish

Hi,
Pls remove me from your mail list. I don't use protege anymore.

Thanx

On 15 Apr 2014 03:24, "betafish" <[hidden email]> wrote:
Hi,

I have been trying to use SPARQL-DL API [1] for querying my OWL2 file. What
I'm trying to do it to look for ObjectProperty between two classes i.e. (if
[object property exist bw these two classes] then [execute rule X])
--------------------------------
OWL2 file snippet:

<owl:ObjectProperty rdf:ID="isManagedBy">
          <rdf:type rdf:resource="owl#FunctionalProperty" />
            <rdfs:domain rdf:resource="#FunctionManagement" />
            <rdfs:range rdf:resource="#SymposiumPlanner2013"/>
        </owl:ObjectProperty>

--------------------------
processQuery(
                                "PREFIX : <http://ibis.in.tum.de/projects/paw#>\n"
                                + "SELECT ?x ?y WHERE {\n" +
                                            "PropertyValue(?x,:isManagedBy, ?y)" +
                                        "}"
                                );

Error: Given entity in first argument of atom PropertyValue() is not an
individual.
--------------------------------


[1]:http://www.derivo.de/en/resources/sparql-dl-api/sparql-dl-examples.html



--
View this message in context: http://protege-project.136.n4.nabble.com/SPARQL-DL-API-ObjectPropery-of-a-class-Tbox-query-tp4660228.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
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