6,226 questions
0
votes
1
answer
36
views
Limiting cardinality of predicates in SPARQL queries
I'm trying to create a query to match what we call the "shape" of a node in our rdf data. One of the things that goes into this shape is a cardinality for each type of predicate that can ...
0
votes
0
answers
28
views
Wikidata SPARQL request fails with : Headless value factory should not be asked for its namespace
I have a SPARQL request that extracts various data for geographic locations from Wikidata:
SELECT DISTINCT ?h ?hLabel ?type ?location ?parent ?north ?south ?east ?west ?area
WHERE
{
VALUES (?h) {(wd:...
2
votes
0
answers
57
views
Why does this query timeout while this similar one does not?
I wanted to know for each president, in what state were they born, so I wrote this Wikidata query:
SELECT * WHERE {
# P31 = instance of
# Q5 = human (excludes fictional characters)
?president ...
1
vote
1
answer
73
views
Does RDFLib offer static/semantic validation for SPARQL (beyond parseQuery)?
parseQuery in RDFLib catches syntax errors, but I can not find a way to make RDFLib flag semantic/static issues (e.g., GROUP BY mismatches) before execution on a remote endpoint. translateQuery was ...
0
votes
0
answers
27
views
SPARQL Query Pattern Isomorpher
I want to compare 2 SPARQL queries with each other, especially the query patterns in the WHERE clause. The huge problem is that there are multiple variants that have the same semantic meaning so I am ...
2
votes
1
answer
87
views
Searchstring to WikiData entity ID
Question
How do I get from an animal name (tiger) to its WikiData entity id (Q19939) in a static website?
Context
I am writing a small static website (no backend, just html and vanilla javascript) ...
3
votes
0
answers
44
views
SPARQL Query not retrieving all triples
In Python, I am querying SPARQL queries using SPARQLWRAPPER.
I currently have two queries:
# A lot of PREFIX definitions at the top of the query
INSERT
{{ GRAPH <https://graph-dev....
0
votes
0
answers
40
views
Getting bad request 400 "Invalid system state type mismatch for var(?attr3) vartype(21): rowtype(22)" exception for SPARQL select query on AnzoGraphDB
We have Anzograph database of version 3.1. I am running a SELECT query on empty graph named "DemoGraph", which does not have any tuple in it."
I am running the below query:
PREFIX rdf: &...
1
vote
0
answers
73
views
SELECT query does not return graph name when querying from named graphs
One SPARQL select query returns graph name while another does not return any data for the given example data.
Below is the example data for the two queries. There are two named graphs - Main and ...
2
votes
0
answers
43
views
Slow federated labeling in Wikidata Query Service with path and union
I am running into a query that times out in the Wikidata Query Service (the https://query-main.wikidata.org service with federation). It is using a path query and a UNION with federation to the ...
0
votes
0
answers
14
views
Filter the final results to include only those ?dp which are not associated to more than 1 ?id
Below is my SPARQL query. I would like to get only those rows with ?dp which are associated to only ?id. If a ?dp is associated to more than 1 ?id, rows with these ?dp should be ignored.
I tried GROUP ...
1
vote
0
answers
54
views
BPMN process engine which consumes data from KGs
I am involved in a project and I would like to ask for some advice, opinion, ideas...
The thing is that we have some data stored in a triple-store (GraphDB), with some related ontologies, SHACL rules ...
2
votes
0
answers
41
views
Grouping by to get only the latest info without using GROUP_CONCAT
I have an RDF database which contains events. Events are associated with: a public key (hex string), a timestamp, and various metadata predicates.
User activity generates new events. I have a query ...
2
votes
1
answer
139
views
Querying over named graphs and union graph in Jena
[EDIT] It was my fault: I had garbled the configuration of Jena-Fuseki and the tdb2:unionDefaultGraph parameter was NOT set to true. So no wonder that Jena didn't return the expected results. Also, ...
3
votes
0
answers
97
views
How stop property path on a certain condition?
I would like to be able to find all the resources that are an arbitrary path length removed from the resource I'm interested in, until there is a resource that meets a certain condition.
This question ...
1
vote
1
answer
146
views
How Can I Retrieve Tender Value and Deadline from the TED SPARQL Endpoint?
I'm working with the TED (Tenders Electronic Daily) SPARQL endpoint (https://publications.europa.eu/webapi/rdf/sparql) to extract public procurement tender information. I have the following query ...
1
vote
0
answers
30
views
How to query objects of an entity AND their labels in Wikidata
I want to retrieve all the related objects of an entity and their labels, but I'm struggling against how the label service and the distinction between statements and (actual) entities works in ...
1
vote
1
answer
153
views
Extract the Procurement URL from TED using SPARQL query?
I am trying to use SPARQL query to get the procurement URL or etenders Resource ID from TED
import sparqldataframe
import pandas as pd
# Define the SPARQL query
sparql_query = """
...
0
votes
0
answers
27
views
Getting compilation error on running a long SPARQL query on anzograph
I have installed anzograph frontend 3.1 , I am running a SELECT query with IN Filter having (1,2,3...,1000) values.
The query execution is failing with below error -
/opt/cambridgesemantics/...
1
vote
0
answers
72
views
Apache Jena 4.9.0 [Endpoint returned Content-Type: application/sparql-results+json which is not recognized for SELECT queries.]
I'm developing a tool based on Apache Jena 4.9.0 libraries to issue SELECT queries to a SPARQL endpoint, and execution resulted in error stated at the title
(that is, "Endpoint returned Content-...
2
votes
0
answers
82
views
Converting URI's or string to unique integer in SPARQL
I am in the process of converting a graph to relational database. The schema of the RDB I am converting to requires each person to have a unique ID in the form of an integer. I have unique ID's for ...
2
votes
0
answers
76
views
Query Wikidata by coordinates
I'm querying the Wikidata from Apache Jena Fuseki. The objective is to get a monument by its coordinates. The coordinates I locally have are far more accurate. For instance, the monument Q29566893 in ...
3
votes
1
answer
86
views
Federated Query between two RDFlib graphs
I have two local knowledge graphs in the form of turtle files.
Let's say they look something like:
File1 - people.ttl
Bob a person ;
feeds cat-1 ;
trains dog-1 ;
owns house-1 .
File 2 - ...
0
votes
0
answers
67
views
Unexpected Filter behavior of the attributes present on relations in AnzoGraph
I am developing an application where I want to fetch some relations present in the AnzoGraph. These relations have some attributes and I want to fetch data by applying filter the attribute present on ...
1
vote
1
answer
51
views
How can I return different graphs based on a Construct Sparql Query?
I have a sparql construct query that I use to construct various graphs based on the where clause. The sparql construct query works like this: it returns a model with all the different instances (or ...