On Thursday, December 16, 2010 02:37:48 pm Robert Campbell wrote: > I'm parsing an XML/RDF model from OpenCalais which looks like this: > > ... > <rdf:Description c:contentType="text/raw" c:emVer="7.1.1103.5" > c:langIdVer="DefaultLangId" c:language="English" > c:processingVer="CalaisJob01" c:submissionDate="2009-12-10 > 06:34:26.635" > rdf:about="http://d.opencalais.com/dochash-1/dd3d9746-bbd3-3bd8-abdd-ee102300c824/meta"> > <rdf:type > rdf:resource="http://s.opencalais.com/1/type/sys/DocInfoMeta"/> > <c:docId > rdf:resource="http://d.opencalais.com/dochash-1/dd3d9746-bbd3-3bd8-abdd-ee102300c824"/> > > <c:submitterCode>c8b1bf20-11b5-9426-afb8-1af10ced91a7</c:submitterCode> > > <c:signature>digestalg-1|BA85RL4uWFjMjCfSa0k6iHqawts=|TTosv0VIPySK4HwUpxl76Yvh/ZwIjjCGwCRBAqjB+tDkZNcQUHmLUQ==</c:signature> > </rdf:Description> > ... > > and the Jena model looks like this: > > ... > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:submissionDate "2010-12-16 05:24:30.722"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:docId > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @rdf:type http://s.opencalais.com/1/type/sys/DocInfoMeta; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:language "English"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:processingVer "CalaisJob01"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:emVer "7.1.1103.5"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:submitterCode "c8b1bf20-11b5-9426-afb8-1af10ced91a7"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:contentType "TEXT/RAW"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:langIdVer "DefaultLangId"; > http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta > @c:signature > "digestalg-1|uUMwnVwAYwcoIRl2ozky6uBts7Y=|f6zt1E2yFp3X0TQ8KAJi1TjwAhRMGK0WjmJXDhRTw1rUs6oLbBwP3w=="; > ... > > but what's missing is the "rdf:about" attribute in the rdf:Description > node. I need to be able to query this model to get the rdf:about value > along with many others, but it doesn't seem to be in the model at all. > What am I missing?
rdf:about is just RDF/XML syntax; it doesn't exist in the RDF triple model. It says what the subject of the implied triples is. For example, in your RDF/XML we see: rdf:about="http://d.opencalais.com/dochash-1/dd3d9746-bbd3-3bd8-abdd-ee102300c824/meta" with <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfoMeta"/> And in the model (which is being written out using the informal toString() notation, subject @predicate object) we see things like: http://d.opencalais.com/dochash-1/c2156224-66ed-3538-89f2-7c4b4b197809/meta @rdf:type http://s.opencalais.com/1/type/sys/DocInfoMeta (looks much better with model.write(System.out, "TTL") for Turtle notation). (Yes, different URL because incomplete data in post) The nested <rdf:type ...> has turned into a predicate, and the rdf:about has made http://lotsofstuff/meta the subject in the statement with that predicate. The XML structure of RDF/XML is pretty much irrelevant once it has been read into a model. Chris -- "He remembered -- not one thing, not another thing, nor a logical /Whose Body?/ succession of things, but everything -- the whole thing, perfect, complete in all its dimensions as it were and instantaneously; as if he stood outside the world and saw it suspended in infinitely-dimensional space." Epimorphics Ltd, http://www.epimorphics.com Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT Epimorphics Ltd. is a limited company registered in England (number 7016688)
