Re: how to get the properties of a class?

Hi Szekely,

   Firstly, this is the wrong list for this kind of query. Please use  
semantic-web@w3.org instead.

   Secondly: you are incorrectly operating in a 'conventional' class- 
based OO mindset (instances are of classes, classes define a set of  
properties) which doesn't apply in the property-centric open RDF world.

   Resources are related to other resources and literals by  
properties. That is all. Some of those properties might be implied by  
statements in ontologies, but they are not necessarily present in the  
fragment of graph to which you have access (e.g., all humans have  
mothers, but you don't necessarily know John's mother).

   It is also not the case that membership of a class defines the  
extant properties of an instance. Your question thus doesn't make  
much sense.

   You can ask what properties have a given class as their domain:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?property ?class {
   ?property rdfs:domain ?class .
}

   (but you are reliant on reasoning to deduce subclass relationships)

   or what properties apply to known instances of a class:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?property ?class {
   [ a ?class ;
     ?property ?object ]
}

   but your best solution is to think differently about what you're  
trying to model and achieve.

   Please don't continue this discussion on the public-rdf-dawg- 
comments list; if you like, you can continue on the semantic- 
web@w3.org list, where I am also subscribed.

   HTH,

-R


On  12 Jun 2007, at 10:12 AM, Szekely Zolta wrote:

>
> Hi!
>
> Am am new to RDF. I created an ontology in Protege and I have to  
> use it.
>
> We are working on a web interface in .NET with SPARQL.
>
> I wonder how one can get the list of the properteie (own and  
> inherited) of a class?
>
> I have written something like this: SELECT DISTINCT ?a WHERE {?a  
> rdf:type owl:DatatypeProperty. ?x owl:Class :MyClass}
>
> It does not return anything. I also tried to use filters with  
> regex, but that did not work either.
>
> Thanks,
>
> Székely-Sipos Sándor Zolta

Received on Tuesday, 12 June 2007 18:26:37 UTC