Closed reederz closed 9 years ago
what inconsistencies?
Here's what banana-rdf can parse https://github.com/w3c/banana-rdf/blob/master/rdf/common/src/main/scala/org/w3/banana/io/MimeType.scala#L25-32 . As you can see, they have Ntriples mime type as "application/ntriples" whereas you have it as "text/n3". Same with RdfXml, they have "text/rdf+xml" whereas you have it as "application/rdf+xml".
For the record, W3C says the MIME type of N-triples is text/plain and the MIME type of RDF/XML is application/rdf+xml.
The RDF 1.1 N-Triples W3C Recommendation states that the NTriples media type is application/n-triples
Thanks, my bad. Here is the right link http://www.w3.org/TR/n-triples/
How did you come to the conclusion that you needed to make these exact changes to get react-foaf running?
I'll work through changes one by one.
Stack trace
Caused by: rww.ldp.ParserException: Can't parse http://bblfish.net/people/henry/card with any mime types of Set(MimeType(text,turtle,Map( charset -> utf-8))). Original contentType was Some(text/turtle; charset=utf-8)
at rww.ldp.WSClient$$anonfun$rww$ldp$WSClient$$tryToReadAsGraph$1.applyOrElse(WebClient.scala:134) ~[na:na]
at rww.ldp.WSClient$$anonfun$rww$ldp$WSClient$$tryToReadAsGraph$1.applyOrElse(WebClient.scala:134) ~[na:na]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) ~[scala-library.jar:na]
at scala.util.Failure.recoverWith(Try.scala:172) ~[scala-library.jar:na]
at rww.ldp.WSClient.rww$ldp$WSClient$$tryToReadAsGraph(WebClient.scala:134) ~[na:na]
at rww.ldp.WSClient$$anonfun$fetch$1.apply(WebClient.scala:95) ~[na:na]
... 16 common frames omitted
Caused by: rww.ldp.MissingParserException: no RDF Reader found for mime type MimeType(text,turtle,Map( charset -> utf-8)) for reading http://bblfish.net/people/henry/card
Stacktrace:
Caused by: rww.ldp.ParserException: Can't parse https://social.umeahackerspace.se/mmn/foaf with any mime types of Set(MimeType(application,rdf+xml,Map())). Original contentType was Some(application/rdf+xml)
at rww.ldp.WSClient$$anonfun$rww$ldp$WSClient$$tryToReadAsGraph$1.applyOrElse(WebClient.scala:134) ~[na:na]
at rww.ldp.WSClient$$anonfun$rww$ldp$WSClient$$tryToReadAsGraph$1.applyOrElse(WebClient.scala:134) ~[na:na]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) ~[scala-library.jar:na]
at scala.util.Failure.recoverWith(Try.scala:172) ~[scala-library.jar:na]
at rww.ldp.WSClient.rww$ldp$WSClient$$tryToReadAsGraph(WebClient.scala:134) ~[na:na]
at rww.ldp.WSClient$$anonfun$fetch$1.apply(WebClient.scala:95) ~[na:na]
... 16 common frames omitted
Caused by: rww.ldp.MissingParserException: no RDF Reader found for mime type MimeType(application,rdf+xml,Map()) for reading https://social.umeahackerspace.se/mmn/foaf
at rww.ldp.WSClient.rww$ldp$WSClient$$readGraph(WebClient.scala:174) ~[na:na]
Without the change no.1 , react-foaf won't even load. With the changes, I get your foaf graph nicely loaded in the browser:
@bblfish I can clean up this PR with the stuff from you comments if needed.
First one Caused by: rww.ldp.ParserException: Can't parse http://bblfish.net/people/henry/card with any mime types of Set(MimeType(text,turtle,Map( charset -> utf-8))). Original contentType was Some(text/turtle; charset=utf-8)
There are a couple of problems there:
Given that there are better libraries we want to use for all the http stuff, your solution could be a reasonable hack until we move to such a lib. But on the other hand we could try to get this right...
better libraries we want to use for all the http stuff
What http stuff are you referring to here? eg b-rdf mime, the actual parsers, etc
Looking at http://www.w3.org/TR/n-triples/ the content has to be UTF-8 and no optional parameters are permitted
Looking at http://www.w3.org/TR/turtle/, the content has to be UTF-8 but an optional parameter of "charset" may be provided with only the value "UTF-8".
So it looks to me, after a very quick look (ie I may be completely wrong) that the official specs are not accurately implemented in b-rdf. Iff that's the case, seems reasonable to fix it in b.rdf.
If there are other non.conforming examples there (such as instance where other charsets may be specified), they should be updated and the specific laws applied.
It seems to me that you're right. Let's see if @bblfish can second it. Perhaps then we should make an issue on b-rdf.
Do these latest fixes solve the problems here? https://github.com/w3c/banana-rdf/pull/228 My guess is that we are not dealing well enough with character encodings, but this should be ok for this version.
I still get errors about application/rss+xml; charset=UTF-8 , text/plain; charset=utf-8 . But it works for the other formats discussed in this thread. I guess we could close the issue (or do we wait until it's in w3c/banana-rdf?)
@reederz , that is because the first format is not rdf - it could be seen as such with the right parser, but that needs to be written - and the second is not rdf either.
both of them seem to have rdf data in them, regardless of the mime types.
yes, in the case of text/plain it is the server's mistake then. They should publish the info in the correct mime type. We can build something later to help notify people of these mistakes. Rss+xml if it is rss1.0 is very close to rdf... Working with other people's mistakes is something for later. :-)
Needed this to get react-foaf up and running. Perhaps there's a better way to solve this and it should be reported to banana-rdf people. What do you think?