Re: wildcard resource representation

Phil Archer wrote:
>
> Our work is, of course, driven by its use cases. Ours are centred on 
> things like trustmarks, standards compliance and, potentially, 
> licensing. In all those scenarios you need to be describing a defined 
> set of resources, typically those collected in a Web site. Therefore 
> we believe some restriction on what is being described is necessary 
> and we define <wdr:ResourceSet /> as the empty set. That said, your 
> example raises an issue we've not discussed, i.e. what if the RS 
> definition is tantamount to the universal set. Hmmmm...

It sounds as if our use cases are not that similar. You want to 
basically match different forms of URIs. I want to answer questions 
like, "Which principals can access this resource? Perhaps a particular 
individual, three particular individuals, any individuals of the class 
of users, any individuals at all, individuals who have purchased the 
resource, etc."

So like most other things I've had to roll my own.

This rule applies to a single identified resource:

<marmot:AccessRule>
    <marmot:select>
        <marmot:URISelector>
            <marmot:selectURI 
rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">mailto:peter@example.com<marmot:selectURI>
        </marmot:URISelector>
    <marmot:select>
</marmot:AccessRule>

This rule applies to three identified resources:

<marmot:AccessRule>
    <marmot:select>
        <marmot:UnionSelector>
            <marmot:select>
                <marmot:URISelector>
                    <marmot:selectURI 
rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">mailto:peter@example.com<marmot:selectURI>
                </marmot:URISelector>
                <marmot:URISelector>
                    <marmot:selectURI 
rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">mailto:paul@example.com<marmot:selectURI>
                </marmot:URISelector>
                <marmot:URISelector>
                    <marmot:selectURI 
rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">mailto:mary@example.com<marmot:selectURI>
                </marmot:URISelector>
            </marmot:select>
        </marmot:UnionSelector>
    </marmot:select>
</marmot:AccessRule>

This rule selects all resources of type MyType:

<marmot:AccessRule>
    <marmot:select>
        <marmot:PropertySelector>
            <marmot:selectProperty 
rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
            <marmot:selectValue rdf:resource="http://example.com#MyType"/>
        </marmot:PropertySelector>
    </marmot:select>
</marmot:AccessRule>

This rule selects all resources (as would the above example if the 
select type value was changed to rdf:Resource):

<marmot:AccessRule>
    <marmot:select>
        <marmot:UniversalSelector/>
    </marmot:select>
</marmot:AccessRule>

You can nest unions, intersections, negations, etc. for complex selections.

Cheers,

Garret

Received on Thursday, 2 August 2007 13:39:02 UTC