On 23/08/13 00:10, Holger Knublauch wrote:
On 8/23/2013 2:06, Andy Seaborne wrote:
Based on your experience, when does it make a difference?
A number of our test cases broke, and I tracked it down to the case
where the base URI of a graph ends with something like .owl yet the file
is saved in ttl.
So the specific issue here is about ".owl".
".owl" is registered in RIOT as being RDF/XML.
There isn't an official registration of the file extension AFAICS, the
nearest I found was from OWL1 (nothing in WOL2):
http://www.w3.org/TR/owl-ref/#MIMEType
[[
2.3 MIME type
The Web Ontology Working Group has not requested a separate MIME type
for OWL documents. Instead, we recommend to use the MIME type requested
by the RDF Core Working Group, namely application/rdf+xml [RDF
Concepts], or alternatively the XML MIME type application/xml.
As file extension, we recommend to use either .rdf or .owl.
]]
Obviously, a bit out of date.
Maybe .owl should not be assigned a registered meaning in the reader
registry.
A number of our ontologies used such naming conventions
in the past, and I wouldn't be surprised if others are now in the same
situation where they started with some base URI and used it in
owl:imports etc, and then changed the serialization to Turtle. While the
base URI ends with .owl, the input stream is still coming from a local
file ending with .ttl. But our application knows that these are really
turtle files, and since we take control of owl:imports this is IMHO a
valid scenario.
There are three pieces of information to consider: content type (if
from the web), the user specified language and the file extension.
What happens when there is contradictory information is a pragmatic
decision. Hence the "don't trust text/plain" part -- too many Turtle
files come back text plain!
Yes that's fine but our case above is not related to the HTTP response
type, but should rely entirely on the information passed into the read
as third parameter (FileUtils.langTurtle etc). If the latter is provided
then it should override anything else, and things like response type and
file ending should only be used if no language "hint" has been provided.
The general mismatch remains that the Model.read API states that the
language is the file type, while RIOT changes this to be a hint only. I
believe changing the order of the two if statements from my previous
message would be a better implementation, and restore the behavior of
the Model.read API.
Sure (although in this case, no ".owl" also should work).
Hope this clarifies things.
Yes - except I didn't understand the bit about OWL imports.
Thanks,
Holger
I can see that declared syntax should not override file extension.
Whether it should override HTTP content type (which I do worry about) is
less clear ATM. Thinking about that.
A workaround is RDFDataMgr.parse(StreamRDF, InputStream, null, Lang)
Andy