SPARQL-Anything / sparql.anything

SPARQL Anything is a system for Semantic Web re-engineering that allows users to ... query anything with SPARQL.
https://sparql-anything.cc/
Apache License 2.0
220 stars 11 forks source link

failing to parse turtle file #515

Open cristianvasquez opened 5 days ago

cristianvasquez commented 5 days ago

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:

<a> <b> <c> .

I can successfully fetch and query this file locally using the following query:

PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT *
WHERE {
  {
    SERVICE <x-sparql-anything:> {
      fx:properties fx:media-type "text/turtle" ;
                    fx:location "http://127.0.0.1:8080/file.ttl" .
      ?s ?p ?o .
    }
  }
}

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!

luigi-asprino commented 5 days ago

Hi

Thank you for creating SPARQL Anything—it’s an incredible tool!

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

kvistgaard commented 5 days ago

@luigi-asprino that's great. Can you please include that fix in the next pre-release?

luigi-asprino commented 5 days ago

It is the https://github.com/SPARQL-Anything/sparql.anything/releases/tag/v1.0-DEV.9