RE: What inferences should be made

Okay, here's my first crack at rules for showing the contradiction Alan mentioned, i.e., that <http://sw-app.org/mic.xhtml#i> is both a foaf:Person and an html:DocumentPortion.  BTW, if the lines below get garbled in email, then it may be easier to read the attachment.

Let's assume an app has a triple:

        _:foo dc:creator <http://sw-app.org/mic.xhtml#i> .

And we'll assume that in parsing the above triple, the app *also* automatically asserted the following triple, in order to remember what URI was used to denote the resource:

        <http://sw-app.org/mic.xhtml#i> log:uri
                "http://sw-app.org/mic.xhtml#i"^^xsd:anyURI .

Now suppose that the app somehow decides that it wants to learn more about the resource denoted by http://sw-app.org/mic.xhtml#i .  To do so, it uses a few rules.  The first rule extracts the RDF and HTML (separately) from the RDFa:

# See prefix declarations at the end of this message.
{       ?r log:uri ?u .                         # IF a resource is denoted by URI ?u
        ?u log:racine ?racine .                 # ... which has racine ?racine
        ?racine mhttp:hasResponse ?reply .      # ... and a GET yields response ?reply
        ?reply http:status "200" .              # ... which was 200 OKAY
        ?reply mime:body ?body .                # ... and it has body ?body
        ?reply mime:content-type "rdfa" .       # ... which is mime type RDFa
        ?body rdfa:parsedAsRDFA ?rdfa . # ... which parses to RDFa ?rdfa
} => {                                          # THEN
        ?u mhttp:yields ?f .                    # ... dereferencing ?u yields ?f
        ?f a log:Formula .                      # ... which is RDF
        ?u mhttp:yields ?h .                    # ... and dereferencing ?u yields ?h
        ?h a html:HTML .                                # ... which is HTML
        }

The second rule is specific to the RDF mime type.  It says that RDF that comes back is asserted.

{       ?u mhttp:yields ?f .                    # IF dereferencing ?u yields ?f
        ?f a log:Formula .                      # ... which is RDF
} => ?f .                                               # THEN assert it.

And according to Alan's message at
http://lists.w3.org/Archives/Public/public-awwsw/2007Dec/0011.html
the RDFa at http://sw-app.org/mic.xhtml contains embedded RDF that explicitly asserts:

        <http://sw-app.org/mic.xhtml#i> a foaf:Person .

or something to that effect.  I didn't check, but I'll take that as a given.

The third rule is specific to HTML mime types.  It indicates that in HTML, a fragment identifier denotes a portion of a document (or a location within a document):

{       ?u log:racine ?u .                      # IF ?u is already a racine (no frag ID)
        ?u mhttp:yields ?h .                    # ... and dereferencing it yields ?h
        ?h a html:HTML .                                # ... which is HTML
        ?h html:containsID ?id .                # ... and it contains ID ?id
        (?u "#" ?id) string:concatenation ?uid . # ... and the URI ?u#?id
        ?rid log:uri ?uid .                     # ... denotes a resource ?rid
} =>    {                                               # THEN
        ?rid a html:DocumentPortion .           # ... it is a document portion.
        }

Alan's message also says that the RDFa at http://sw-app.org/mic.xhtml contains id:"i", which by the third rule means:

        <http://sw-app.org/mic.xhtml#i> a html:DocumentPortion .

And AWWW seems to suggest the people are no document portions:

        html:DocumentPortion owl:disjointWith foaf:Person .

and so we have a contradiction.

The above rules assume the following prefixes:

        @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
        @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
        @prefix log: <http://www.w3.org/2000/10/swap/log#>.
        # HTTP ontology mentioned by Jonathan:
        @prefix http: <http://www.w3.org/2007/ont/http#> .

        # Ontology for more about HTTP:
        @prefix mhttp: <http://example/more-http> .
        mhttp:hasResponse a rdf:Property ;
                rdfs:domain xsd:anyURI ;
                rdfs:range http:ResponseMessage .
        mhttp:ParsedBody a rdf:Property .       # Any result of parsing a MIME body
        mhttp:yields a rdf:Property ;           # What dereferencing a URI yields
                rdfs:domain xsd:anyURI ;
                rdfs:range ParsedMimeBody .

        # Ontology for interpreting RDFa:
        @prefix rdfa: <http://example/mime-type-rdfa> .
        rdfs:RDFA a rdfs:Class .                # RDFa documents
        rdfa:parsedAsRDFa a rdf:Property ;      # Analogous to log:parsedAsN3
                rdfs:domain mime:Body ;
                rdfs:range rdfa:RDFa .
        rdfa:containsRDF a rdf:Property ;
                rdfs:domain rdfa:RDFa ;
                rdfs:range log:Formula .
        rdfa:containsHTML a rdf:Property ;
                rdfs:domain rdfa:RDFa ;
                rdfs:range html:HTML .

        # Ontology for interpreting HTML:
        @prefix html: <http://example/mime-type-html> .
        html:HTML a rdfs:Class ;                # HTML documents
                rdfs:subClassOf mhttp:ParsedBody .
        html:parsedAsHTML a rdf:Property ;      # (Not used in this example)
                rdfs:domain mime:Body ;         # (Not used in this example)
                rdfs:range html:HTML .          # (Not used in this example)
        html:containsID a rdf:Property ;
                rdfs:domain html:HTML ;
                rdfs:range xsd:string .
        html:DocumentPortion a rdfs:Class .     # Location denoted by a frag ID.



David Booth, Ph.D.
HP Software
+1 617 629 8881 office  |  dbooth@hp.com
http://www.hp.com/go/software

Opinions expressed herein are those of the author and do not represent the official views of HP unless explicitly stated otherwise.

Received on Tuesday, 8 January 2008 07:22:12 UTC