ruby-rdf / rdf-rdfa

Ruby RDFa reader/writer for RDF.rb.
http://ruby-rdf.github.com/rdf-rdfa
The Unlicense
35 stars 11 forks source link

`Statement is invalid` while loading graph #29

Closed paranoicsan closed 5 years ago

paranoicsan commented 5 years ago

Consider the HTML markup containing such line

<div vocab="http://schema.org/" typeof="MusicPlaylist"></div>

Getting Statement is invalid error here:

<>html/body/div: statement <> <http://www.w3.org/ns/rdfa#usesVocabulary> <http://schema.org/> .
   is invalid

But can be correctly handled here

gkellogg commented 5 years ago

The only reason it's considered invalid is that there is no base URI for the document. You can pass this with the base_uri option, or the --uri option to the rdf shell command, or set it in the document.

It will generate an output if you don't validate, but validation is the default when generating N-Triples. Try it in the distiller using http://rdf.greggkellogg.net/distiller?command=serialize&format=rdfa&output_format=turtle&url=http:%2F%2Fexample%2F

paranoicsan commented 5 years ago

@gkellogg thanks for the clarification! Will close the issue as solved then.