|
From: Richard C. <ri...@cy...> - 2005-04-26 17:46:09
|
Hi Jonathan,
Am 26.04.2005 um 17:10 schrieb Jonathan Hendler:
[...]
> For example - in this case I want all all the mammals and their
> properties
>
> WHERE (?a, rdf:type, myns:Mammal) , (?b, rdfs:domain, ?a)
>
> ?a gives me instances of people and mammals
> but using the whole RDQL above doesn't work.
> Shouldn't ?b be the list of properties for at least Mammal, and maybe
> Persons
> too?
No, because rdfs:domain connects properties to classes, not properties
to instances. It's
myns:hasTeeth rdfs:domain myns:Mammal.
and not
myns:hasTeeth rdfs:domain ex:Richard. (where ex:richard is a
myns:Mammal).
To get all properties of myns:Mammal, try this:
WHERE (?property rdfs:domain myns:Mammal)
To get all properties that are defined on some kind of mammal (like
myns:hasProperName), you would do something like this:
WHERE (?property rdfs:domain ?class), (?class rdfs:subClassOf
myns:Mammal)
(I didn't actually try anything of this.)
Cheers,
Richard
|