W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > July 2013

Re: distiller behaviour without base href

From: Ivan Herman <ivan@w3.org>
Date: Tue, 30 Jul 2013 13:49:37 +0200
Cc: W3C RDFa WG <public-rdfa-wg@w3.org>
Message-Id: <E4BD9E6C-285E-4C7E-858B-D91B14C96AE5@w3.org>
To: Dan Brickley <danbri@google.com>
Sorry to be late on the party, I was on vacations...

I tested this by putting the snippet on the Web in a proper HTML file[1], and then ran it through my distiller:

http://goo.gl/oXUlLW

and the result is:

[[[
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .

schema:sku a rdf:Property,
        owl:Property;
    rdfs:label "sku";
    schema:domainIncludes <http://www.ivan-herman.net/Demand>,
        <http://www.ivan-herman.net/Offer>,
        <http://www.ivan-herman.net/Product>;
    schema:rangeIncludes <http://www.ivan-herman.net/Text>;
    rdfs:comment """The Stock Keeping Unit (SKU), i.e. a
		merchant-specific identifier for a product or service, or the product
		to which the offer refers.""" .

]]]

What happens, b.t.w., is that pyRdfa resolves relative URI-s if it know how to do it, ie, because it has either a URI or at least a file name (ie, file:/// URI) at its disposal. If you run a test in the user interface with direct code, there is no such thing; then pyRdfa just 'pushes' the relative URI down to RDFLib, essentially, and the latter produces the (otherwise correct) Turtle...

Ie, things seem to o.k. to me...

Cheers

Ivan

[1] http://www.ivan-herman.net/Misc/2013/dan_rdfa.html

On Jul 3, 2013, at 23:17 , Dan Brickley <danbri@google.com> wrote:

> I'm experimenting with RDFa for per-term pages on schema.org. I fed
> this chunk of markup to your RDFa 1.1 distiller,
> http://www.w3.org/2012/pyRdfa/#distill_by_input+with_options
> 
> <div resource="http://schema.org/sku" typeof="rdf:Property
> owl:Property" property="rdfs:label" content="sku">
> 
> <h1 class="page-title">Property: <a href="sku">sku</a></h1>
> 
> <div property="rdfs:comment">The Stock Keeping Unit (SKU), i.e. a
> merchant-specific identifier for a product or service, or the product
> to which the offer refers.</div>
> 
> <table cellspacing="3" class="definition-table">
> <tr><th class="rangeIncludes-vals" scope="row" colspan="2">Values
> expected to be one of these types:</th></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/rangeIncludes"
> href="/Text">Text</a></code></td><td></td></tr>
> 
> <tr><th class="domainIncludes-vals" scope="row" colspan="2">Used on
> these types:</th></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/domainIncludes"
> href="/Offer">Offer</a></code></td><td></td></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/domainIncludes"
> href="/Product">Product</a></code></td><td></td></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/domainIncludes"
> href="/Demand">Demand</a></code></td><td></td></tr>
> 
> </table>
> 
> </div>
> 
> 
> Result was:
> 
> @prefix owl: <http://www.w3.org/2002/07/owl#> .
> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix schema: <http://schema.org/> .
> 
> schema:sku a rdf:Property,
>        owl:Property;
>    rdfs:label "sku";
>    schema:domainIncludes </Demand>,
>        </Offer>,
>        </Product>;
>    schema:rangeIncludes </Text>;
>    rdfs:comment "The Stock Keeping Unit (SKU), i.e. a
> merchant-specific identifier for a product or service, or the product
> to which the offer refers." .
> 
> 
> ... is that even Turtle?
> 
> If I wrap my markup fragment in a trivial HTML shell and declare the
> base href in header, i.e. this, it works.
> 
> <html>
> <head>
> <title>test</title>
> <base href="http://schema.org/" />
> </head>
> <body>
> <div resource="http://schema.org/sku" typeof="rdf:Property
> owl:Property" property="rdfs:label" content="sku">
> 
> <h1 class="page-title">Property: <a href="sku">sku</a></h1>
> 
> <div property="rdfs:comment">The Stock Keeping Unit (SKU), i.e. a
> merchant-specific identifier for a product or service, or the product
> to which the offer refers.</div>
> 
> <table cellspacing="3" class="definition-table">
> <tr><th class="rangeIncludes-vals" scope="row" colspan="2">Values
> expected to be one of these types:</th></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/rangeIncludes"
> href="/Text">Text</a></code></td><td></td></tr>
> 
> <tr><th class="domainIncludes-vals" scope="row" colspan="2">Used on
> these types:</th></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/domainIncludes"
> href="/Offer">Offer</a></code></td><td></td></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/domainIncludes"
> href="/Product">Product</a></code></td><td></td></tr>
> 
> <tr class="type-nam"><td><code><a
> property="http://schema.org/domainIncludes"
> href="/Demand">Demand</a></code></td><td></td></tr>
> 
> </table>
> 
> </div>
> </body>
> </html>
> 
> 
> @prefix owl: <http://www.w3.org/2002/07/owl#> .
> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix schema: <http://schema.org/> .
> 
> schema:sku a rdf:Property,
>        owl:Property;
>    rdfs:label "sku";
>    schema:domainIncludes schema:Demand,
>        schema:Offer,
>        schema:Product;
>    schema:rangeIncludes schema:Text;
>    rdfs:comment "The Stock Keeping Unit (SKU), i.e. a
> merchant-specific identifier for a product or service, or the product
> to which the offer refers." .
> 
> 
> (Gregg's behaves the same in both cases, http://rdf.greggkellogg.net/distiller )
> 
> My conclusions:
> 
> 1. I don't understand this result syntax:  </Offer> nor why both tools
> produce it; I thought they were different codebases (python vs ruby).
> 
> 2. it would seem important for RDFa-checking tools to have some
> options to deal with setting the base URI, and/or reporting when it
> isn't set and might be giving weird results.
> 
> It seems like http://rdfa.info/play/ silently patches up examples by
> assuming a base href of http://rdfa.info/ hence parses my first sample
> into triples such as
> "  ... schema:domainIncludes <http://rdfa.info/LocalBusiness>;"
> 
> Lately I'm testing with all 3 tools; when they agree, I guess I'm
> heading in right direction...
> 
> cheers,
> 
> Dan


----
Ivan Herman, W3C 
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf
Received on Tuesday, 30 July 2013 11:50:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:34 UTC