-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failing to parse turtle file #515
Comments
Hi
Glad to hear that :-) This is a bug. The media type is used to select the triplifier, but when it comes to reading the file and identifying the language, it is ignored and the triplifier cannot determine the language and therefore cannot read it. 5c42c1f should fix the problem |
@luigi-asprino that's great. Can you please include that fix in the next pre-release? |
I think we can close this issue now |
Hello @luigi-asprino, could we re-open the issue? I'm getting the same error when using a remote file containing the following: PREFIX fx: <http://sparql.xyz/facade-x/ns/>
<a> <b> <c> .
The query: PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT *
WHERE {
SERVICE <x-sparql-anything:> {
fx:properties
fx:location "https://gist.githubusercontent.com/cristianvasquez/45b1c05729b9bf469da67ac18cf32519/raw/c4f93f95bf43047bac213df414bad61e88631b15/mini.ttl" ;
fx:media-type "text/turtle" .
?s ?p ?o .
}
} Interestingly I don't get that error if I serve the file locally |
Just to make sure, Turtle and SPARQL are not the same when it comes to prefix declarations. PREFIX fx: <http://sparql.xyz/facade-x/ns/>
<a> <b> <c> . while this should be: @prefix fx: <http://sparql.xyz/facade-x/ns/> .
<a> <b> <c> . Is that your problem? |
Sorry, I tried to isolate the problem but I made a mistake :) The file that failed was the following: https://raw.githubusercontent.com/SEMICeu/BregDCAT-AP/refs/heads/main/releases/2.1.0/BRegDCAT-AP_shacl_shapes_2.1.0.ttl With query:
|
OK, I see the problem. With 5c42c1f#diff-2216d69f6038f63ffb0a2cd69a77bb2f83c7d4e4be758c0ef17d774a0a50afbaR60 we added the media type as a way to detect the correct RDF language BUT, this only happens after checking the HTTP Content-Type declaration. Instead, we should always assume that the media type configured gets precedence. In your case, the returned Content-Type is text/plain, which is mapped to NT by Jena RIOT. Reopening. |
Hi,
Thank you for creating SPARQL Anything—it’s an incredible tool!
I’m encountering an issue while trying to fetch a Turtle file from the web. The file I’m working with contains the following content:
I can successfully fetch and query this file locally using the following query:
However, if I rename the file to have a different extension (e.g., file.something), it fails to parse. This leads me to suspect that the fx:media-type property is not being respected in this case.
Could you provide any guidance or confirm if this is a bug?
Thank you!
The text was updated successfully, but these errors were encountered: