Hello Nathan, Re.loading:
> Option 1: RDF+XML w/ CDATA > <content:encoded><![CDATA[<p>some <strong>html</strong> in > here.</p>]]></content:encoded> Without parseType="Literal" it should become a string. With CDATA it is a string, otherwise it's a RDF/XML structure error or something unexpected, depending on the content of the XML. > Option 2: rdf:XMLLiteral in turtle/n3 > <http://something.com/anyoluri> > <content:encoded> """<p xmlns="http://www.w3.org/1999/xhtml">some > <strong xmlns="http://www.w3.org/1999/xhtml">html</strong> in > here.</p>"""^^rdf:XMLLiteral . It works for me with current CVS checkout. > Option 3: XML+RDF w/ namespace and embedded XML > <?xml version="1.0" encoding="UTF-8"?> > <rdf:RDF > xmlns="http://www.w3.org/1999/xhtml" > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > xmlns:content="http://purl.org/rss/1.0/modules/content/" > xmlns:sioc="http://rdfs.org/sioc/ns#"> > > <sioc:Post rdf:about="http://something.com/anyoluri"> > <content:encoded rdf:parseType="Literal"> > <p>some <strong>html</strong> here.</p> > </content:encoded> > </sioc:Post> > </rdf:RDF> It works for me with current CVS checkout. > Details on Option 3: > The XML snippets gets stored correctly as an XMLLiteral (great), however: > > -a: can't get any of the bif:(x|xpath_|xquery_)contains methods to work > correctly It works for me with current CVS: SQL> DB.DBA.RDF_LOAD_RDFXML ('<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sioc="http://rdfs.org/sioc/ns#"> <sioc:Post rdf:about="http://something.com/anyoluri"> <content:encoded rdf:parseType="Literal"> <p>some <strong>html</strong> here.</p> </content:encoded> </sioc:Post> </rdf:RDF>', 'http://g3/', 'http://g3/'); Done. -- 9 msec. SQL> sparql select (bif:xpath_eval ('//strong', ?o, 1)) from <http://g3/> where { ?s <http://purl.org/rss/1.0/modules/content/encoded> ?o }; callret-0 VARCHAR _______________________________________________________________________________ <n0:strong xmlns:n0="http://www.w3.org/1999/xhtml">html</n0:strong> 1 Rows. -- 47 msec. > > -b: differing errors occur when output in sparql results (as follows): > > > SELECT w/ content type "application/rdf+xml": > error: > <res:valuerdf:parseType="Literal"> > note: > the lack of a space between res:value and rdf:parseType Oops. My fault. Fixed now. > > > SELECT w/ content type "text/rdf+n3": > error: > res:binding [ res:variable "o" ; res:value "some html here." ] > note: > converted to only text, all xml stripped It works in current CVS > SELECT w/ content type "text/plain" (turtle) > error: > "some html > here."^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> > note: > XMLLiteral is correct, but xml is stripped again It works in current CVS > CONSTRUCT w/ application/rdf+json > error: > "value" : "some html here." , "datatype" : > "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" > note: > all xml stripped but XMLLiteral correct It works in current CVS > CONSTRUCT w/ text/rdf+n3 > error: > content:encoded some html here. . > note: > everything stripped, no type quotes anything It works in current CVS > DESCRIBE w/ text/rdf+n3 > error: > content:encoded "some html here." . > note: > quoted, but no type & xml stripped It works in current CVS > DESCRIBE w/ application/rdf+json > error: > "value" : "some html here." , "datatype" : > "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" > note: > all xml stripped but XMLLiteral correct Fixed. Best Regards, Ivan Mikhailov OpenLink Software http://virtuoso.openlinksw.com
