Re: Semantics question (was Re: XSLT question)

OK, thanks very much Stasinos, that's hugely helpful. I've worked (and 
re-worked) through your comments on all this and would like to propose 
the following which, I hope, is in line with what you have said and, no 
less important, can be encoded in the XSLT that Kev is working on right now.

I've prepared several examples of POWDER descriptor sets and their 
equivalent DR-S versions. Logically they begin with a simple one and end 
up hideously complex just to prove that the same rules can be applied 
and yield a consistent answer.

So, the simple one first:

<descriptorset>
   <ex:property1>value</ex:property1>
</descriptorset>

Gives

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property1" />
       <owl:hasValue>value</owl:hasValue>
     </owl:Restriction>
   </owl:IntersectionOf>
</owl:Class>

I think that's uncontentious. The use of intersectionOf is unnecessary 
with a single property restriction but we discussed that on Monday's 
call and agreed this was how we'd do it (so the processing rules remain 
the same when there are more restrictions).

Next we have a case where the DR refers to a descriptor set in another 
document. See 
http://www.w3.org/2007/powder/Group/powder-dr/20080325.html#preDefinedDescriptors

<descriptorset ref="http://example.org/powder.xml#d1" />

Now http://example.org/powder.xml#d1 is not an RDF or OWL class, it's 
another POWDER descriptor element so we use ref and this generates a see 
also statement:

<owl:Class rdf:nodeID="descriptorset_1">
   <rdfs:seeAlso rdf:resource="http://example.org/powder.xml#d1" />
</owl:Class>

The assertion that the resource set is a sub class of this will be 
pretty meaningless - but accurate. The alternative would be to require 
POWDER processors to fetch the other document, extract the descriptor 
set and process that into POWDER-S which sounds like a possible 
never-ending loop - hence I suggest we leave it at "see also.' I guess a 
POWDER Processor MAY fetch the external resource and process it but I 
don't think it should be required to do so.

But what if the external resource is an OWL class? Then I think we 
should refer to it as such like this:

<descriptorset
     rdf:resource="http://example.org/semantic/powder.rdf#d1" />

Which becomes

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Class
       rdf:resource="http://example.org/semantic/powder.rdf#d1" />
   </owl:IntersectionOf>
</owl:Class>

So much for descriptor sets that are empty except for the reference to 
external data. What if they are not empty? Let's go back to the ref 
example and we get:

<descriptorset ref="http://example.org/powder.xml#d1">
   <ex:property1>value</ex:property1>
</descriptorset>

Which, following the same rules as before, gives us

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property1" />
       <owl:hasValue>value</owl:hasValue>
     </owl:Restriction>
   </owl:IntersectionOf>
   <rdfs:seeAlso rdf:resource="http://example.org/powder.xml#d1" />
</owl:Class>

And for the rdf:resource one we get:

<descriptorset rdf:resource="http://example.org/semantic/powder.rdf#d1">
   <ex:property1>value</ex:property1>
</descriptorset>

Which is GRDDLed into

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Class
       rdf:resource="http://example.org/semantic/powder.rdf#d1" />
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property1" />
       <owl:hasValue>value</owl:hasValue>
     </owl:Restriction>
   </owl:IntersectionOf>
</owl:Class>

If the value of a property is a class then we have this situation:

<descriptorset>
   <ex:property1>value</ex:property1>
   <ex:property2
       rdf:resource="http://example.org/semantic/powder.rdf#d1" />
</descriptorset>

Which generates:

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property1" />
       <owl:hasValue>value</owl:hasValue>
     </owl:Restriction>
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property2" />
       <owl:hasValue
          rdf:resource="http://example.org/semantic/powder.rdf#d1" />
     </owl:Restriction>
   </owl:IntersectionOf>
</owl:Class>

I suggest that <ex:property ref="..." is simply not allowed (and ex 
isn't the POWDER namespace so we couldn't define what to do with it anyway)

If the desired description is just another Class with no associated 
property then it can be written in directly thus:

<descriptorset>
   <ex:property1>value</ex:property1>
   http://example.org/semantic/powder.rdf#d1
</descriptorset>

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property1" />
       <owl:hasValue>value</owl:hasValue>
     </owl:Restriction>
     <owl:Class
       rdf:resource="http://example.org/semantic/powder.rdf#d1" />
   </owl:IntersectionOf>
</owl:Class>

Note, this is equivalent to adding an rdf:resource attribute to 
descriptorset, however, multiple classes can be included this way 
whereas rdf:resource takes a single URI.

I did consider introducing a new element of <seealso /> which, of 
course, would map to rdfs:seeAlso. This would allow the inclusion of 
multiple see also statements but... since ref can take whatever value we 
say - and I suggest we say it takes a white space separated list - the 
ref attribute on the descriptorset element is sufficient.

So let's try a hideously complex example just for the sake of it.

<descriptorset ref="&abc; &def;"
      rdf:resource="http://example.org/semantic/powder.rdf#d1">
   <ex:property1>value</ex:property1>
   http://example.org/semantic/powder.rdf#d2
   <ex:property3
      rdf:resource="http://example.org/semantic/powder.rdf#d3" />
</descriptorset>

Following the same rules, we get this

<owl:Class rdf:nodeID="descriptorset_1">
   <owl:intersectionOf rdf:parseType="Collection">
     <owl:Class
       rdf:resource="http://example.org/semantic/powder.rdf#d1" />
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property1" />
       <owl:hasValue>value</owl:hasValue>
     </owl:Restriction>
     <owl:Class
       rdf:resource="http://example.org/semantic/powder.rdf#d2" />
     <owl:Restriction>
       <owl:onProperty rdf:resource="&ex;property3" />
       <owl:hasValue
         rdf:resource="http://example.org/semantic/powder.rdf#d3" />
     </owl:Restriction>
   <rdfs:seeAlso rdf:resource="&abc;" />
   <rdfs:seeAlso rdf:resource="&def;" />
   </owl:IntersectionOf>
</owl:Class>

WDYT?

Phil.



Stasinos Konstantopoulos wrote:
> On Tue Apr 22 17:57:45 2008 Phil Archer said:
> 
>> <descriptorset>
>>   <icra:na>1</icra:na>
>>   <icra:vj>1</icra:vj>
>>   <bbfc:rating rdf:resource="http://www.bbfc.org/1997/#12" />
>> </descriptorset>
>>
>> [...] become this in POWDER-S:
>>
>> <owl:Class rdf:nodeID="descriptorset_1">
>>   <owl:intersectionOf rdf:parseType="Collection">
>>     <owl:Restriction>
>>       <owl:onProperty rdf:resource="&icra;#na" />
>>       <owl:hasValue>true</owl:hasValue>
>>     </owl:Restriction>
>>     <owl:Restriction>
>>       <owl:onProperty rdf:resource="&icra;#vj" />
>>       <owl:hasValue>true</owl:hasValue>
>>     </owl:Restriction>
>>     <*owl:Class* rdf:resource="http://www.bbfc.org/1997/#12" />
>>   </owl:intersectionOf>
>> </owl:Class>
>>
>> So the ICRA descriptors (which have literal values) would become 
>> property restrictions on the OWL class. The BBFC rating becomes another 
>> class and the descriptor set is the intersection of all three.
>>
>> The use of rdf:resource tells the processor that the referred to item is 
>> an RDF (or OWL) class and not another POWDER (XML) descriptor set. For 
>> that we'd use ref, i.e.
>>
>> <descriptorset>
>>   <icra:na>1</icra:na>
>>   <icra:vj>1</icra:vj>
>>   <bbfc:rating ref="http://www.bbfc.org/1997/#12" />
>> </descriptorset>
>>
>> Now that becomes something different in POWDER-S because we're referring 
>> to something else that is a description but that is not an RDF or OWL 
>> class - it could be anything, hence this would become
>>
>> <owl:Class rdf:nodeID="descriptorset_1">
>>   <owl:intersectionOf rdf:parseType="Collection">
>>     <owl:Restriction>
>>       <owl:onProperty rdf:resource="&icra;#na" />
>>       <owl:hasValue>true</owl:hasValue>
>>     </owl:Restriction>
>>     <owl:Restriction>
>>       <owl:onProperty rdf:resource="&icra;#vj" />
>>       <owl:hasValue>true</owl:hasValue>
>>     </owl:Restriction>
>>   </owl:intersectionOf>
>>   <*rdfs:seeAlso* rdf:resource="http://www.bbfc.org/1997/#12" />
>> </owl:Class>
>>
>> This class still has the ICRA property restrictions but now just says 
>> 'take a look over there as well' but the BBFC rating is not part of the 
>> actual description.
> 
> If the BBFC vocabulary is really RDF then bbfc:12 cannot be anything, it
> has to be a either a class, an instance, or a relation. If one can
> resolve bbfc: then it becomes obvious what 12 is, and in any case the
> POWDER author will have to know what it really is and use it
> appropriately (see previous email). I guess the rdfs:seeAlso allows one
> to not have to know, but then is should be expressed by a similarly
> agnostic construct in POWDER/XML. If one writes:
>   <bbfc:rating ref="http://www.bbfc.org/1997/#12" />
> in POWDER/XML, one has already made the commitment that bbfc:rating is a
> property and bbfc:12 is an instance which is our resource's value for
> the bbfc:rating property.
> 
> s
> 

Received on Wednesday, 23 April 2008 10:59:02 UTC