Re: Reference versus xsd:anyURI Literal in JSON-LD

On Jul 10, 2011, at 5:21 PM, Manu Sporny wrote:

> On 07/10/2011 11:12 AM, Niklas Lindström wrote:
>> a quick remark regarding the current use of "xsd:anyURI" in "coerce"
>> directives in JSON-LD (both in the spec and the playground). That
>> should really be "@iri", not "xsd:anyURI". The latter means the value
>> is a *literal* (with datatype xsd:anyURI), and not a *reference*.
> 
> Good idea, if you look in Section 2.5 of the Basic spec:
> 
> http://json-ld.org/spec/latest/basic/#an-example-of-a-context
> 
> I tried out "IRI", but as you say above, "@iri" makes more sense. It
> also has the added benefit of not requiring the developer to specify the
> "xsd" prefix if they just want to do @iri coercion. Anyone opposed to
> this change - replace "xsd:anyURI" to "@iri" in @coerce?
> 
> Should we do the same for "@literal" - at the moment, we use xsd:string.
> I think that the RDF Working Group just stated that "xsd:string" is the
> same as a plain literal. We could do something inline with that decision:
> 
> "@context":
> {
>   "@coerce":
>   {
>      "@literal": ["foaf:name", "dc:title"]
>   }
> }
> 
> This would effectively state that the context wants the output to be a
> plain literal, regardless of whether or not language information or
> datatype information is specified. I don't necessarily like this as it
> could end up making data /less/ specific. The previous features which
> add @iri coercion and @datatype coercion would work in the opposite
> direction w/ @literal - removing any @iri, @language, and @datatype
> information.

My interpretation of the RDF WG's recommendation is that we could use xsd:string to refer to string literals without a language and rdf:PlainLiteral to refer to literals that may have a language but not a datatype. rdfs:Literal denotes a literal that may have either a language, a datatype or neither.

The only reason to use something like "@literal" would be to avoid introducing RDF terms, but semantically I think they're describing much the same thing.

Your use of "@literal" is effectively the same as "xsd:string", in which case I'd just use that. If we need to say something about literals that don't have a datype, we could use rdf:PlainLiteral, but I don't see why this is necessary.

Gregg

> -- manu
> 
> -- 
> Manu Sporny (skype: msporny, twitter: manusporny)
> President/CEO - Digital Bazaar, Inc.
> blog: PaySwarm Developer Tools and Demo Released
> http://digitalbazaar.com/2011/05/05/payswarm-sandbox/
> 

Received on Monday, 11 July 2011 01:25:39 UTC