Re: Type of string literals in RDF

* Pat Hayes <phayes@ihmc.us> [2017-11-14 11:27-0600]
> 
> > On Nov 8, 2017, at 7:08 PM, Victor Porton <porton@narod.ru> wrote:
> > 
> > I am developing a rather complex RDF vocabulary.
> > 
> > Some data is in string format. For example, I use string literals to
> > describe a Unix command to be executed by my software. Or for another
> > example, I use strings to describe XSLT parameter names. Or to describe
> > program version numbers such as "11.3".
> > 
> > My question: When validating an RDF file, should I check that these
> > strings are of xsd:string type? or should I accept arbitrary types of
> > such "string" literals?
> 
> For RDF compliance, the former. All RDF strings (aka ‘plain literals’) have the RDF type xsd:string. You may associate a different ‘type’ with the literal by an explicit assertion using your own type vocabulary, but that would be a modeling layer above RDF itself. 
> > 
> > What is better from the viewpoint of complex system design?
> 
> If you want to be compatible with other RDF data and RDF engines, only one choice is possible. 

I was reading this as "should I require that version be an xsd:string or should I permit e.g. xsd:float?"

There are two schools of thought here:

  1 specify a very specific vocabulary in order to promote interoperability.

  2 specify a general vocab and use additional constraints when you bind it to an application.

For the latter, you can define e.g. x:version:

  x:version a rdf:Property ;

and some application can further constrain it:

  <MyApplicationThingy> {
    x:version xsd:float
  }

Dublin Core offers examples of a general vocab, e.g. dc:creator. Shapes languages are still pretty new but we expect this paradigm to work well.


> Pat Hayes
> 
> > 
> > 
> > 
> 
> 
> 

-- 
-ericP

office: +1.617.599.3509
mobile: +33.6.80.80.35.59

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

There are subtle nuances encoded in font variation and clever layout
which can only be seen by printing this message on high-clay paper.

Received on Tuesday, 14 November 2017 20:39:30 UTC