RE: Format of fragment identifier

On Friday, May 31, 2013 10:08 PM, Hans Teijgeler wrote:
> Hi Markus,
> 
> Thank you, but too technical :(

:-)


> Example from the triple store:
> http://www.xyz-corp.com/lifecycledata#T13b25ba6-7940-11e2-b92a-
> 0800200c9a66
> 
> Is that T after the # necessary?

As I said, it depends. In Turtle

  @base <http://www.xyz-corp.com/lifecycledata> .
  @prefix lcd: <http://www.xyz-corp.com/lifecycledata#> .
  @prefix ex: <http://example.com/> .

  <#13b25ba6-7> ex:worksJustAsThisDoes lcd:13b25ba6-7

or JSON-LD you never need to add a letter:

  {
    "@context": {
      "@base": "http://www.xyz-corp.com/lifecycledata",
      "lcd" "http://www.xyz-corp.com/lifecycledata#"
      "worksJustAsThisDoes": {
         "@id": "http://example.com/xy", "@type": "@id" }
    },
    "@id": "#13b25ba6-7",
    "worksJustAsThisDoes": "lcd:13b25ba6-7"
  }


In RDF/XML it is not necessary if you use a relative IRI as in

  <?xml version="1.0"?>
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
           xml:base="http://www.xyz-corp.com/lifecycledata"
           xmlns:ex="http://example.com/",
           xmlns:lcd="http://www.xyz-corp.com/lifecycledata#">
    <rdf:Description rdf:about="#13b25ba6-7">
      <ex:prop>This is OK, but the next property is not</ex:prop>

but it you cannot abbreviate such a URI using a prefix as in

      <lcd:1234>in XML the suffix cannot start with a number</ex:1234>

    </rdf:Description>
  </rdf:RDF>

as the suffix (the 1234 in the example above) must start with a letter or an
underscore.


Hope this clarifies things,
Markus


--
Markus Lanthaler
@markuslanthaler

Received on Friday, 31 May 2013 20:48:14 UTC