semarglproject / semargl

Highly performant, lightweight framework for linked data processing. Supports RDFa, JSON-LD, RDF/XML and plain text formats, runs on Android and GAE, provides integration with Jena, Sesame and Clerezza.
Other
51 stars 17 forks source link

JSON-LD parser does not like @context consisting in only a URI #41

Open kaefer3000 opened 9 years ago

kaefer3000 commented 9 years ago

Hi,

I tried to parse the default Person example from http://json-ld.org/playground/index.html

{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Professor",
  "telephone": "(425) 123-4567",
  "url": "http://www.janedoe.com"
}

but I only get one triple, whose URIs have been resolved wrongly (against the base URI I submitted):

_:n0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Person> .

I get similar behaviour for the JSON-LD test cases, by changing @context such that it is only a URI, and not a JSON object, so I guess the @context parsing is to blame.

Cheers!

aharth commented 9 years ago

The following works though:

{
  "@context": {
    "@vocab": "http://schema.org/"
  },
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Professor",
  "telephone": "(425) 123-4567",
  "url": "http://www.janedoe.com"
}