sparql

SPARQL Queries with Fuseki Server on Ubuntu 18.04

别来无恙 提交于 2020-07-03 12:01:24
问题 I'm trying to run SPARQL queries with Fuseki Server on Ubuntu 18.04. When I try to start the server in the terminal with ./fuseki-server --update --mem /ds , I get the following errors. I've seen some similar questions and I assume it has something to do with compatibility issues with Java 11. I've installed Java 8, and I still get the same errors. I'm not sure how to proceed from here. WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance. 2020-06-18

Determining Day Of Week For Datetime in SPARQL

梦想与她 提交于 2020-06-27 17:45:09
问题 I have a graph I am trying to filter for a report by day of week. For instance, I wish to find all the instances where they occurred on a Tuesday. Is there a way to either format the datetime field into day of week or filter by day of week directly on the datetime field? 回答1: You can also determine the day of week in standard SPARQL if you provided a bit of background knowledge. The query needs a reference date preceding your dates and the day of week at this date. PREFIX xsd: <http://www.w3

How to filter by BlankNode id

家住魔仙堡 提交于 2020-06-27 17:07:50
问题 I'm trying to run this query in the SPARQL playground on GraphDB . select * where { ?s content:value ?value . FILTER REGEX(str(?value), "_:x1697BD364N0abcdd866d54") } ?value are BNodes I'm trying to filter all values where the BNode ID is: _:x1697BD364N0abcdd866d54 I've tried a few different ways to filter by the ID: FILTER REGEX(str(?value), "#bnode-id") FILTER (?value), "#bnode-id") but none was a success. Questions: How would you filter based on a bnode id? Is it possible to STR(bnode) ?

How to filter by BlankNode id

血红的双手。 提交于 2020-06-27 17:07:20
问题 I'm trying to run this query in the SPARQL playground on GraphDB . select * where { ?s content:value ?value . FILTER REGEX(str(?value), "_:x1697BD364N0abcdd866d54") } ?value are BNodes I'm trying to filter all values where the BNode ID is: _:x1697BD364N0abcdd866d54 I've tried a few different ways to filter by the ID: FILTER REGEX(str(?value), "#bnode-id") FILTER (?value), "#bnode-id") but none was a success. Questions: How would you filter based on a bnode id? Is it possible to STR(bnode) ?

How to filter by BlankNode id

安稳与你 提交于 2020-06-27 17:07:12
问题 I'm trying to run this query in the SPARQL playground on GraphDB . select * where { ?s content:value ?value . FILTER REGEX(str(?value), "_:x1697BD364N0abcdd866d54") } ?value are BNodes I'm trying to filter all values where the BNode ID is: _:x1697BD364N0abcdd866d54 I've tried a few different ways to filter by the ID: FILTER REGEX(str(?value), "#bnode-id") FILTER (?value), "#bnode-id") but none was a success. Questions: How would you filter based on a bnode id? Is it possible to STR(bnode) ?

How to filter by BlankNode id

眉间皱痕 提交于 2020-06-27 17:07:07
问题 I'm trying to run this query in the SPARQL playground on GraphDB . select * where { ?s content:value ?value . FILTER REGEX(str(?value), "_:x1697BD364N0abcdd866d54") } ?value are BNodes I'm trying to filter all values where the BNode ID is: _:x1697BD364N0abcdd866d54 I've tried a few different ways to filter by the ID: FILTER REGEX(str(?value), "#bnode-id") FILTER (?value), "#bnode-id") but none was a success. Questions: How would you filter based on a bnode id? Is it possible to STR(bnode) ?

How to query Wikidata items using its labels?

本小妞迷上赌 提交于 2020-06-09 12:13:48
问题 How can I query Wikidata to get all items that have labels contain a word? I tried this but didn't work; it retrieved nothing. SELECT ?item ?itemLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "en". ?item rdfs:label ?itemLabel. } FILTER(CONTAINS(LCASE(?itemLabel), "keyword")) } LIMIT 1000 回答1: Following your question and the useful comments provided, I ended up with this query SELECT ?item ?itemLabel WHERE { ?item rdfs:label ?itemLabel. FILTER(CONTAINS(LCASE(

How to query Wikidata for “also known as”

给你一囗甜甜゛ 提交于 2020-05-27 04:32:12
问题 I would like to know how to query Wikidata by using the alias ("also known as"). Right now I am trying SELECT ?item WHERE { ?item rdfs:aliases ?alias. FILTER(CONTAINS(?alias, "Angela Kasner"@en)) } LIMIT 5 This is simply a query that works if I replace rdfs:aliases by rdfs:labels . I am trying this, because Help:Aliases says that aliases are searchable in the same way as labels, but I can't find any other resource on that nor can I find an example. 回答1: This query might be helpful for someone

is there a way to parameterize a sparql filter condition?

荒凉一梦 提交于 2020-05-17 06:01:30
问题 I am trying to find out what is the best way to parameterize a filter condition with a float value taken as input. count=25.67 FILTER(?price < count) instead of: FILTER ( ?price < 25.67 ) The value of "count" will be taken as input. I would like to know the syntax for including the object count in the FILTER command. Thank you in advance. 回答1: Here's an example of setQuery use with a parameter added via `.format(): from SPARQLWrapper import SPARQLWrapper, JSON def query_dbpedia(my_uri) sparql

“or” in a SPARQL query

社会主义新天地 提交于 2020-05-09 20:35:06
问题 I don't quite understand why in SPARQL they haven't implemented the basic logic operators. However in most of the cases is possible to obtain the same result in a number of way. The purpose of this question is to have a quick reference for the possible way troughs that can substitute an "or" statement. Here's what I can think of: 1) UNION e.g: SELECT * WHERE { { ?s :propA ?o } UNION { ?s :propB ?o } } -not often suitable because it can became very verbose because SELECT * WHERE { { GRAPH ?g {