Questions tagged [sparql]

SPARQL (pronounced "sparkle", a recursive acronym for SPARQL Protocol and RDF Query Language) is a set of specifications by W3C that provide languages and protocols to query and manipulate RDF graph content on the Web or in an RDF store.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Incorrect result in SHACL validation

I am trying to validate a data graph against the shape graph using pyshacl. Basically, the data graph represents a geometric representation of two walls in a building, whose distance from each other ...
AJAY AGRAWAL's user avatar
0 votes
1 answer
13 views

SPARQL aggregated query with 2 WHERE and 2 GROUP BY?

I am using a database with bands, their albums and the release date of the albums. I'm trying to get a table with one column for the number of albums released in the 1980s, and one column for the ...
SusVej's user avatar
  • 1
0 votes
0 answers
15 views

Understanding of SHACL Function Parameters

I was trying to understand how SHACL functions work from the SHACL documentation available on W3C working group notes. The function code given there is as follows: ex:multiply a sh:SPARQLFunction ;...
AJAY AGRAWAL's user avatar
1 vote
0 answers
36 views

Why is this query not working when put into a larger query?

Query 1 shows that the chemical element "americium" was named after "Americas" which was named after "Amerigo Vespucci". Query 2 shows chemical elements with some ...
xhgf5's user avatar
  • 11
1 vote
1 answer
23 views

SPARQL , only take specific value from schema and use NaN when not available?

I'm doing SPARQL queries on the Swiss company registry database zefix. One of the companies there is for example: https://register.ld.admin.ch/zefix/company/182509 As you can see, it has three ...
Maru's user avatar
  • 11
1 vote
0 answers
14 views

BadSyntax error while validating Datagraph against SHACL shapes in pyshacl

I am trying to validate a data graph against a shape graph in pyshacl. The objective is to check the distance between two walls from a linked building data representation of a small building. The code ...
AJAY AGRAWAL's user avatar
0 votes
0 answers
28 views

Writing Shapes Graph (SHACL-SPARQL) in python using rdflib, pyshacl

I am trying to validate a data graph against a shapes graph using pyshacl, which is a Python library for working with SHACL. I have the data graph stored as a '.ttl' file in my system, which I have ...
AJAY AGRAWAL's user avatar
1 vote
1 answer
26 views

graphDB SPARQL Error 501: Not Implemented

On a fresh install of graphDB, in the SPARQL web UI tab, I receive a HTML501 error: Not Implemented when some statements (ORDER BY for example) are present in the SPARQL query. Additional tests: I ...
mquantin's user avatar
  • 1,115
0 votes
1 answer
22 views

SPARQL query mixes up different statement nodes for Q-item

Edit: Please read the comments to this post - the post itself is answered. The relevant part of my query (retrieving Nobel Prize winners who, at the time of winning, were head of state or head of ...
xhgf5's user avatar
  • 11
2 votes
1 answer
30 views

Unable to get label querying Wikidata SPARQL endpoint

I'm trying to query the Wikidata SPARQL endpoint through a Python script. I'm successfully getting the QID of the entities but I'm unable to get the label. PREFIX rdfs: <http://www.w3.org/2000/01/...
eespie's user avatar
  • 35
0 votes
0 answers
31 views

Getting all triple having rdf:type

I want to get all triple with rdf:type from DBpedia, I am querying DBpedia at https://dbpedia.org/sparql SELECT * WHERE { <http://dbpedia.org/resource/Michael_Jackson> rdf:type ?object} ...
Alexandra's user avatar
0 votes
0 answers
38 views

Query Takes 5 Hours on First Run After Docker Restart

I'm using GraphDB version 10.2.0. I am encountering a performance issue with GraphDB that I hope you can help me with. Here's the situation: Problem Description: When I initially run a specific query ...
zubaria asma's user avatar
0 votes
0 answers
20 views

SPARQL query to match the entity type from two ttl files

I have a ttl file from Yago, and ttl file contains NER from DBpedia Examples Yago ttl files <Jungle_Lord> rdf:type <wordnet_oeuvre_103841417> . <Jungle_Lord> rdf:type <...
Rahul's user avatar
  • 11
1 vote
1 answer
35 views

How do I set the language of a variable in SPARQL?

I know how to set the language of a literal: "foo"@en But what about ?foo@en (which doesn't work)? Context: I want to copy a bunch of labels set to en-gb into just en so they play better ...
Paul Kelly's user avatar
0 votes
0 answers
15 views

How to match DBpedia entity with Yago transitive type

I have extracted DBpedia entity from text using DBpedia spotlight light, now I wanted to get the respective type from wordnet. I have entity like Saccobolus_glaber http://dbpedia.org/resource/...
Alexandra's user avatar
1 vote
1 answer
25 views

Escaping quotes in SPARQL

How do I escape quotes in this SPARQL query? SELECT * WHERE { <http://dbpedia.org/resource/Andre_\"Dede\"_Sabino> rdfs:label ?lbl . ?sub a foaf:Person . ?sub rdfs:label ?lbl . optional ...
Rob Sedgwick's user avatar
  • 4,354
3 votes
1 answer
47 views

Repeated pattern in a SPARQL query that can't (?) be reduced to a property path

I have this SAPRQL query that is growing because there are multiple paths by which Biosamples can be converted into ProcessedSamples. I'm having a hard time figuring out how I will abstract out the ...
Mark Miller's user avatar
  • 3,041
1 vote
0 answers
30 views

query wikidata sparql to get specific word etymology from wiktionary

I'm trying to get the specific word etymology from wikidata. for example this query to get the word "exact" in wikidata but I wasn't able to get the etymology part for this word. SELECT ...
Omar Al-Howeiti's user avatar
0 votes
1 answer
36 views

Sparql query to match unique item identifier from wikidata

I'm trying to get properties value for a given wikidita item from the identifier unique identifier (e.g. wd:Q200639). Let's say I want Paul Valéry's birth date (https://www.wikidata.org/wiki/Q200639). ...
Tetro's user avatar
  • 7
3 votes
2 answers
66 views

CONSTRUCT a DISTINCT set of triples by following paths in SPARQL

I am trying to write a SPARQL query that will extract all relevant triples from a triplestore, using Construct. Essentially, the triplestore is containing a bunch of JSON-LD documents that got parsed ...
qqq's user avatar
  • 1,390
1 vote
1 answer
31 views

Get weighted shortest path in an Openlink Virtuoso Knowledge Graph

Context Given a certain KG with the following structure <distanceTo:1> <weight> 3 . <distanceTo:1> <weight> 4 . <a> ...
Ramshell's user avatar
-2 votes
1 answer
26 views

Wikidata SPARQL queries returning less results than expected

Why does this query return only 175 results? SELECT DISTINCT ?item ?itemLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". } { SELECT ...
Night Walker's user avatar
  • 20.7k
0 votes
1 answer
27 views

How can I get the results from one org-mode cell as a table to process in another?

In my document I create a first cell block for retrieving data: #+name: raw-dataset #+BEGIN_SRC sparql :url https://query.wikidata.org/sparql :format text/csv :cache yes :exports both SELECT ?wLabel ?...
lukascbossert's user avatar
0 votes
0 answers
31 views

Where clause on SPARQL query

How to add a where clause to the following query to select all schools with field 'PROVINCIA' equal to 'Vicenza'? PREFIX miur: <http://www.miur.it/ns/miur#> PREFIX miur: <http://www.miur.it/...
LittleIron's user avatar
1 vote
0 answers
34 views

SPARQL to SQL query rewriting engine

I am looking for ontology based data access (OBDA) system capable of SPARQL to SQL query rewriting to convert the following SPARQL query: SELECT ?interface ?ip WHERE { ?interface network:hasIpAddress ...
Dmitrii Tokarenko's user avatar
0 votes
0 answers
17 views

GraphDB history and versioning plugin weird behaviour

Trying to go through the guide to use the plugin it looks like the filter behaviour looks inconsistent. After the three steps: Inserting data INSERT DATA { <urn:Kirk> <urn:dateOfBirth&...
Petr Křemen's user avatar
0 votes
0 answers
15 views

how to create sub schema of wiki data using wDumper for different time frame

I want to use WDumper to get sub-schema, however the sub-schema needs to be version or year specific. For instance, I need  disease sub-schema of Wikidata  for each of the following years: 2016, 2017, ...
atik ishrak's user avatar
0 votes
0 answers
12 views

DBPedia: extracting data to csv -> Missing <namespace-iri-string> error message

I'm trying to extract the birthyear of veterans from a DBPedias database using SPARQL and order them by their birthyear. Needless to say I'm a History student and we have to do this course, I do not ...
Trendcutter's user avatar
0 votes
1 answer
18 views

Getting Labels in SPARQL Aggregate

The following query is working: SELECT ?goal (count(?ngo) as ?ngoCount) WHERE {?ngo a ngo:NGORecipient; ngo:hasSDGGoal ?goal. ?goal rdfs:label ?sdglabel.} GROUP BY ?...
Michael DeBellis's user avatar
0 votes
0 answers
18 views

sparql wikidata question : how to get several labels?

I want to get the xLabel and the nodeLabel at the same time... SELECT ?x ?xLabel ?dn ?dd ?de ?df ?nodetext WHERE { ?x p:P39 ?node. ?node ps:P39 wd:Q70495953. #on sélectionne les éléments qui sont ...
user1788720's user avatar
0 votes
1 answer
41 views

Retrieving set of instances via owl:sameAs on Ontotext GraphDB

Assuming we have the following set of facts loaded on Ontotext GraphDB: @prefix : <http://www.example.org#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . :bbq_sauce a :Ingredient ; ...
Stratos K's user avatar
  • 341
2 votes
2 answers
47 views

Convert anyURI-typed string representations of CURIes to real CURIes or IRIs

I have triples like this, where the object is an anyURI-typed string representation of a CURIe. I would like to construct the triples with the object as a true CURIe or IRI. @prefix source: <https:/...
Mark Miller's user avatar
  • 3,041
0 votes
0 answers
31 views

GraphDB 10.3 exception on SPARQL query: "Bad IRI string: id 3139, type -1 --> iriString null (HTTP status 500)"

In trying to run the following query on GraphDB 10.3: PREFIX p: <http://www.example.com/ontology/xyz/> select * where { values ?s { p:abc } ?s ?p ?o . } It gives the following error: ...
Nick's user avatar
  • 328
1 vote
1 answer
36 views

SPARQL request excluding individuals with certain types

I'm working on a graph where individuals can have any combinations of types from the set {Class1, Class2, Class3, etc.}. Thus, an individual can be of types {Class1, Class 4} or {Class6} or {Class1, ...
Corlin's user avatar
  • 57
0 votes
1 answer
32 views

How to get instanceof property (class) in wikidata SPARQL query?

I have a wikidata SPARQL query that gets all instances of type "event" (occurrence in space/time) near a particular location (e.g. Nevada): SELECT ?event ?eventLabel ?date ?location WITH { ...
Alex's user avatar
  • 2,813
1 vote
1 answer
48 views

Display a level three groupby/sum from a SPARQL query as rows and columns and filter on years

I have some RDF data which I simplified with the below table. Subject StartDate EndDate Location Technology Value Subject1 1-1-2005 1-1-2025 ZoneA TechnologyA 100 Subject2 1-1-2007 1-1-2025 ZoneB ...
A. Zuiker's user avatar
0 votes
0 answers
46 views

Snap SPARQL Query: Classes

I have a question regarding the "snap SPARQL query" in Protege. I have the following ontology: @prefix : myOntology#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: &...
Agatha Christie's user avatar
1 vote
1 answer
35 views

How to generate SPARQL query to extract the publisher type?

How to generate SPARQL query to extract the publisher @type from a RDF like the one below? It should extract "Organization". It should find the first "publisher" block and extract ...
Henley Wing Chiu's user avatar
1 vote
1 answer
30 views

SPARQL query to find the geoshape a coordinate is in

I have knowledge graph with sf:Point (for example "POINT(51.95656412820512 5.880331774358974)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>). I want to know which country or ...
Sibbe Bakker's user avatar
1 vote
1 answer
42 views

Solution to sequence conversion

I am execution below SPARQL query into qconsole, this query executed properly and returned a solution with 2346 items, it took 5 ms. xquery version "1.0-ml"; import module namespace sem = &...
DevNinja's user avatar
  • 1,459
1 vote
3 answers
76 views

SPARQL query running too slow, when quering, sometimes timesout, is there a way to optimize the query?

My Wikidata Query Service query sometimes takes 35000 milliseconds or 35 seconds to complete. I'm not very adept at SPARQL. The query below does work (except it does duplicates sometimes). I'm wanting ...
Travis's user avatar
  • 1,684
0 votes
0 answers
24 views

How can I prioritize a SPARQL query to query for one thing, before quering another?

The query below simply goes to Wikipedia and grabs famous people born with the date given. I want the query to first prioritize famous people born in the USA first, then the UK, and then everyone ...
Travis's user avatar
  • 1,684
1 vote
0 answers
35 views

getting label of a property from a large query takes much longer and timeout

Let's say I want to retrieve the "sex or gender" (P21) of all people (i.e. human = Q5) that has an IMDb ID (P345) from Wikidata I could get the total list which is nearly 444k lines in less ...
Cyril Chaboisseau's user avatar
2 votes
0 answers
44 views

SPARQL Join based on blank RDF nodes

Please excuse the (possible) triviality of the question. I want to confirm that my understanding of the SPARQL specification is correct. I imagine joining in SPARQL based on blank RDF nodes works just ...
Median Hilal's user avatar
  • 1,493
0 votes
0 answers
25 views

Rewriting a SPARQL Conjunctive Query according to an OWL2 QL ontology

I have an OWL2 QL ontology like the following one: Prefix(:=<http://example.org/my-ontology#>) Ontology(<http://example.org/my-ontology> Declaration(Class(:Student)) Declaration(Class(:...
Oz Nerol's user avatar
-1 votes
1 answer
22 views

Get start date of marriage through a Wikidata SPARQL query

I would like to change this query which only provides the start date of marriage for one item (wd:Q42) WHERE {wd:Q42 p:P26 ?statement. ?statement ps:P26 ?spouse; pq:P580 ?...
F Gh's user avatar
  • 65
0 votes
0 answers
34 views

Given the existence of one property, check for the existence of another using shacl

I want to use shacl to validate if a specific relationship exist, that another relationship exists as well. For example, given the next data with 1 person listing the other 2 as their parent, I want ...
Joep van Genuchten's user avatar
0 votes
0 answers
21 views

Error: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Unknown transaction in Blazegraph

I am running below SPARQL query to delete some triples from blazegraph (from UPDATE tab). DELETE { graph <http://example.org/mapping> { ?s ?b ?c } } where { graph <http://example.org/...
rshar's user avatar
  • 1,375
0 votes
1 answer
35 views

dotNetRdf Query to Sparql endpoint not working

I am struggeling to run Sparql queries from within my .NET 7 application. First, I am configuring my HttpClient in Program.cs services.AddHttpClient("sparql", httpClient => { ...
MikeJ82's user avatar
  • 153
0 votes
1 answer
45 views

Error while deleting triples from a graph in Blazegraph

I am beginner in SPARQL and in my current task I have to delete some triples where the subject matches a specific string. I am running this delete query on a graph in Blazegraph. This is my query: ...
rshar's user avatar
  • 1,375

1
2 3 4 5
122