hbz / lobid

Linking Open Bibliographic Data
https://lobid.org/
Eclipse Public License 2.0
16 stars 4 forks source link

Wrap an record tag around an rdf xml resource #223

Closed dr0i closed 9 years ago

dr0i commented 9 years ago

Reported by Werner Greßhoff:

Getting multiple records every rdf xml resource should be wrapped in a tag for easier parsing.

ich hatte vor einiger Zeit angeregt das gesamte Ergebnis mit einem Root-Tag zu umklammern, damit ein gültiges XML-Dokument entsteht. Das ist auch passiert, leider ist dabei auch etwas verloren gegangen: das RDF-Tag ist jetzt auch nur noch einmal vorhanden und nicht mehr, wie vorher, um jeden Metadatensatz! Einzelne Dokumente sind damit nur noch über das about-Attribut zu erkennen.

dr0i commented 9 years ago

Maybe this contradicts lobid/lodmill#463 ? What do you think @fsteeg ?

fsteeg commented 9 years ago

Deployed to staging.

Standard request (no scroll), wraps into <docs>:

curl -L --header "Accept: application/rdf+xml" "http://test.lobid.org/resource?q=ehrenfeld" > rdf.xml xmllint rdf.xml rapper -i rdfxml rdf.xml

scroll request, additionally wrapped into <root>:

curl -L --header "Accept: application/rdf+xml" "http://test.lobid.org/resource?q=ehrenfeld&scroll=20100701" > rdf.xml xmllint rdf.xml rapper -i rdfxml rdf.xml

Note that with scroll, subsets of the documents are wrapped into <docs>.

dr0i commented 9 years ago

Deployed to production. Let's wait what Werner says to this solution.

dr0i commented 9 years ago

We got an OK, thus closing.

jschnasse commented 8 years ago

@dr0i asked me to put my observations to here. In rdf4j lib I get an error when consuming rdf+xml data from lobid (e.g. http://lobid.org/resource/HT017612594/about) Cause of Error: org.openrdf.rio.RDFParseException: rdf:RDF not allowed as property element [line 15, column 76]

Example in curl: curl -H"accept: application/rdf+xml" http://lobid.org/resource/HT017612594/about

Example in rapper: rapper -i rdfxml http://lobid.org/resource/HT017612594/about

Rapper also gives a warning but proceeds: rapper: Parsing URI http://lobid.org/resource/HT017612594/about with parser rdfxml rapper: Serializing with serializer ntriples rapper: Warning - URI http://lobid.org/resource/HT017612594/about:1 - Using node element 'docs' without a namespace is forbidden.