Re: owl:sameAs assertions in RDFa

On Apr 1, 2013, at 12:24 PM, Jeremy Tarling <jeremy.tarling@bbc.co.uk> wrote:

> On 01/04/2013 19:45, Gregg Kellogg wrote:
>> On Apr 1, 2013, at 10:10 AM, Kingsley Idehen <kidehen@openlinksw.com> wrote:
>> 
>> > On 4/1/13 12:59 PM, Gregg Kellogg wrote:
>> >> On Apr 1, 2013, at 8:17 AM, Jeremy Tarling
>> <jeremy.tarling@bbc.co.uk> wrote:
>> >>
>> >>> hello all
>> >>>
>> >>> I am trying to make an owl:sameAs assertion in some RDFa. I have
>> the following code:
>> >>>
>> >>> <span rel="rnews:about"
>> resource="http://www.bbc.co.uk/things/4c0ccb99-7042-49e5-bb44-338b540441eb#id">
>> >>>    <span rel="owl:sameAs"
>> resource="http://dbpedia.org/resource/Buckinghamshire_County_Council"></span>
>> >>> </span>
>> >>>
>> >>> (I have declared the rnews and owl prefixes elsewhere in the doc)
>> >>>
>> >>> When I test it only the first statement (rnews:about bbc:thing) is
>> being picked up by linked data extraction tools, the owl:sameAs to the
>> corresponding dbpedia URI is being ignored. Can anyone tell me what I'm
>> doing wrong here please?
>> >> Using my distiller [1], If I use the followiing input:
>> >>
>> >> <div prefix="rnews: http://iptc.org/std/rNews/2011-10-07#">
>> >>   <span rel="rnews:about"
>> resource="http://www.bbc.co.uk/things/4c0ccb99-7042-49e5-bb44-338b540441eb#id">
>> >>      <span rel="owl:sameAs"
>> resource="http://dbpedia.org/resource/Buckinghamshire_County_Council"></span>
>> >>   </span>
>> >> </div>
>> >>
>> >> I get the following output:
>> >>
>> >> @prefix owl: <http://www.w3.org/2002/07/owl#> .
>> >> @prefix rnews: <http://iptc.org/std/rNews/2011-10-07#> .
>> >>
>> >> <> rnews:about
>> <http://www.bbc.co.uk/things/4c0ccb99-7042-49e5-bb44-338b540441eb#id> .
>> >>
>> >>
>> <http://www.bbc.co.uk/things/4c0ccb99-7042-49e5-bb44-338b540441eb#id>
>> owl:sameAs <http://dbpedia.org/resource/Buckinghamshire_County_Council> .
>> >>
>> >> Looks okay to me. Note "owl" is defined in the RDFa initial context.
>> >>
>> >> Gregg
>> >>
>> >> [1] http://rdf.greggkellogg.net/distiller
>> >
>> > Gregg,
>> >
>> > Why not share a complete HTML doc skeleton as this little episode
>> could have a lot of future utility. If you don't mind, please just place
>> the HTML doc you used at Web accessible location (URL).
>> >
>> > The owl:sameAs and rdfs:sameAs scenario has already spooked me :-)
>> 
>> Sure, I put up the document at [1] and a hook to my distiller processing
>> the document is at [2]. Note that this example is a simple case of
>> chaining in RDFa, where the object of a parent element becomes the
>> subject of the child element. This works only with @rel (or @rev) and
>> not with @property, as it's considered an /advanced/ feature.
>> 
>> Gregg Kellogg
>> gregg@greggkellogg.net
>> 
>> [1] http://greggkellogg.net/sameas-example.html
>> [2]
>> http://rdf.greggkellogg.net/distiller?format=turtle&in_fmt=rdfa&uri=http://greggkellogg.net/sameas-example.html
>> 
>> 
>> > Kingsley
>> >>
>> >>> JT
>> >>>
>> >>> --
>> >>> Jeremy Tarling
>> >>> Data Architect, BBC News
>> >>> Future Media News & Knowledge
>> >>> 4th floor New Broadcasting House
>> >>> London W1A 1AA
>> >>> tel: 07799 510 992
>> >>>
>> >>
>> >>
>> >>
>> >
>> >
>> > --
>> >
>> > Regards,
>> >
>> > Kingsley Idehen
>> > Founder & CEO
>> > OpenLink Software
>> > Company Web: http://www.openlinksw.com
>> > Personal Weblog: http://www.openlinksw.com/blog/~kidehen
>> > Twitter/Identi.ca handle: @kidehen
>> > Google+ Profile: https://plus.google.com/112399767740508618350/about
>> > LinkedIn Profile: http://www.linkedin.com/in/kidehen
>> >
>> >
>> >
>> >
>> >
>> 
>> 
> 
> Thanks Greg - yes that was my experience, I first tried to do this object-to-subject switch with @property and it failed, but @rel worked.

People found this behavior confusing, so it's not in RDFa 1.1 Lite, but any conforming RDFa 1.1 processor will understand chaining with @rel.

> I'm having trouble with getting the owl: prefix declared with anything other than a local @xmlns on the <span>, which I suspect is not even legal.

Note that owl: is pre-defined in the RDFa 1.1 initial context. If you're not seeing this, then the processor your using is not properly loading the initial context.

> So far I've tried the following approaches:
> 
> 1. <span prefix="owl:http://www.w3.org/2002/07/owl#" rel="owl:sameAs" resource="http://dbpedia.org/resource/Buckinghamshire_County_Council"></span>

You need whitespace between the "owl" and the ":http:...", such as the following:

<span prefix="owl: http://www.w3.org/2002/07/owl#" rel="owl:sameAs" resource="http://dbpedia.org/resource/Buckinghamshire_County_Council"></span>

@xmlns is deprecated, and really shouldn't be used with HTML5. Add that space, and it works on my distiller.

> 2. <span vocab="http://www.w3.org/2002/07/owl#" rel="sameAs" resource="http://dbpedia.org/resource/Buckinghamshire_County_Council"></span>

That works in my distiller, but seems painful!

> 3. <span xmlns:owl="http://www.w3.org/2002/07/owl#" rel="owl:sameAs" resource="http://dbpedia.org/resource/Buckinghamshire_County_Council"></span>

That will work, but you're using the deprecated @xmlns prefix definition path.

> In each case I have run against your RDF extractor using the example file here [1], only option 3 generates the desired sameAs statement.
> 
> I note your point above about owl being included in the initial RDFa context. Perhaps I am breaking that by declaring xmlns:rnews in the document's <html> element

No, that shouldn't break anything. All these variations (with the correction in 1.) work on my distiller, note you can use the "From Form Input" tab to copy-and-paste such examples. They also work on the W3C RDFa distiller [3]

If you'd like to discuss on IRC, i'm "gkellogg" on W3 and Freenode. I hang out at #rdfa on irc.w3.org.

Gregg

[3] http://www.w3.org/2012/pyRdfa/#distill_by_input

> JT
> 
> [1] http://www.topdrawersausage.net/rnews-example.html
> 
> 

Received on Monday, 1 April 2013 19:40:38 UTC