Open luigi-asprino opened 1 month ago
Hi Luigi,
Thank you for pointing this out. It is a bug indeed.
I have however fixed it and will try to release a fixed version asap.
The below code, for example (both c
and configuration
can be used)
facade_query = """
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
CONSTRUCT { ?s ?p ?o } WHERE {
SERVICE <x-sparql-anything:> {
?s ?p ?o
}
}
"""
e = sa.SparqlAnything()
csv_facade = e.construct(
q=facade_query,
c={
'blank-nodes': 'false',
'location': 'data/artist_data_one.csv',
'csv.headers': 'true'
}
)
print(csv_facade.serialize(format="ttl"))
yields
@prefix fx: <http://sparql.xyz/facade-x/ns/>](http://sparql.xyz/facade-x/ns/%3E> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>](http://www.w3.org/1999/02/22-rdf-syntax-ns#%3E> .
@prefix xyz: <http://sparql.xyz/facade-x/data/>](http://sparql.xyz/facade-x/data/%3E> .
<file:///c:/Users/mr24397/Work%20Folders/Desktop/PhD/code/data/artist_data_one.csv#> a fx:root ;
rdf:_1 <file:///c:/Users/mr24397/Work%20Folders/Desktop/PhD/code/data/artist_data_one.csv##row1> .
<file:///c:/Users/mr24397/Work%20Folders/Desktop/PhD/code/data/artist_data_one.csv##row1> xyz:dates "born 1930" ;
xyz:gender "Female" ;
xyz:id "10093" ;
xyz:name "Abakanowicz, Magdalena" ;
xyz:placeOfBirth "Polska" ;
xyz:placeOfDeath "" ;
xyz:url "http://www.tate.org.uk/art/artists/magdalena-abakanowicz-10093" ;
xyz:yearOfBirth "1930" ;
xyz:yearOfDeath "" .
I get an error with this piece of code
Is configuration available as an argument to query via no-service mode? See https://github.com/SPARQL-Anything/sparql.anything/issues/150