sparql

why this variable is never have a value

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:57:29
问题 I am checking that if an instance has a value for a specific predicate, bound that value to a specific variable, otherwise, bound that variable to the value 1 of type integer. this is my code select ?boosted where { :r1 a ?x optional { ?item rs:boostedBy ?boostedOptional bind (if(bound(?boostedOptional), ?boostedOptional, "1"^^xsd:integer) as ?boosted) } } the value of ?boosted is always empty, look please why please? Note I think you don't need data to test why my code is not working,

SPARQL query REGEX boundary in java returns empty

删除回忆录丶 提交于 2019-12-13 02:55:13
问题 i'm new in SPARQL and Jena. Here i'm using Jena version 2.13. I would like to perform a SPARQL query from java web application with REGEX boundary (\b) . I'm using REGEX boundary to match and find exact word. I'm running the same SPARQL query on protege too. Here my SPARQL query in java : "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + "PREFIX owl: <http://www.w3.org/2002/07/owl#> " + "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#

Get all Wikidata items that have more than 10 languages?

人盡茶涼 提交于 2019-12-13 02:36:21
问题 I'm trying to get the most famous movies in the world from Wikidata with SPARQL. I have the following query: SELECT ?item WHERE { ?item wdt:P31 wd:Q11424. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } which returns ALL movies (about 214143). I basically only need movies that have, let's say, more than 10 language entries on wikipedia, as I'm guessing these will be the most famous ones. Is there a way to do this inside the query itself, without checking

SPARQL limit the result for each value of a varible

試著忘記壹切 提交于 2019-12-13 02:26:49
问题 This is the minimum data required to reproduce the problem @prefix : <http://example.org/rs#> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> :artist1 rdf:type :Artist . :artist2 rdf:type :Artist . :artist3 rdf:type :Artist . :en rdf:type :Language . :it rdf:type :Language . :gr rdf:type :Language . :c1 rdf:type :CountableClass ; :appliedOnClass :Artist ; :appliedOnProperty :hasArtist . :c2 rdf:type :CountableClass ;

RdfParseException: Unexpected Character (Code 114) r was encountered

ぃ、小莉子 提交于 2019-12-13 02:23:56
问题 I am trying to send the following query to DBpedia using dotNetRDF: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX temp: <http://www.example.com/temp/> CONSTRUCT { ?v1 a temp:r. ?v1 temp:p0 ?v2. } WHERE { OPTIONAL { { { SELECT ?v1 WHERE { ?v1 rdfs:comment ?v2. } LIMIT 10 }. ?v1 rdfs:comment ?v2. }. }. } However, I am getting an RdfParseException saying that an unexpected r

SPARQL limiting the query result by a variable instead of the number of rows

白昼怎懂夜的黑 提交于 2019-12-13 02:12:48
问题 Lets say I have the following data set: :a rdf:type :AClass :a :hasName "a"^^xsd:string :a :hasProperty :xa :a :hasProperty :ya :a :hasProperty :za :b rdf:type :AClass :b :hasName "b"^^xsd:string :b :hasProperty :xb :b :hasProperty :yb :c rdf:type :AClass :c :hasName "c"^^xsd:string :c :hasProperty :xc I want to query the data set to give me back everything of an instance of :AClass , but only for two instances. I know I have to use the LIMIT keyword, and I have tried a lot of queries but

SPARQL filter language if possible in multiple value context

☆樱花仙子☆ 提交于 2019-12-13 02:11:23
问题 Consider the following extract from the GeoNames database : @prefix gn: <http://www.geonames.org/ontology#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://sws.geonames.org/690791/> a gn:Feature ; gn:featureClass gn:A ; gn:featureCode gn:A.PCLI ; gn:alternateName "Україна"@uk , "ܐܘܟܪܢܝܐ"@arc , "Ուկրաինա"@hy , "ウクライナ"@ja , "Úkraína"@is; gn:name "Ukraine" ; gn:officialName "Ucraína"@gl , "Ukraine"@fr , "U-crai-na (Ukraine)"@vi , "ཡུ་ཀརེན།"@bo. So, I'm trying to get the name in

SPARQL query results in Protege does not recognize transitive property

徘徊边缘 提交于 2019-12-13 01:43:27
问题 I have almost the same requirement expresed in this question: Get all nodes in a transitive relation I am using Protege 3.4.8. This is an Owl-Lite project. I have a transitive property "contains", which is defined as an object property of type Node Node has descendants of type A, B and C I have individuals that link to each other through contains property like this: A contains B contains C When I run the following SPARQL query: SELECT ?A ?B WHERE { ?A :contains ?B } I get : A1 B1 B1 C1 Due to

sparql-query and sparql-update both are not the same?

◇◆丶佛笑我妖孽 提交于 2019-12-13 01:00:11
问题 I find that these are two different query languages: SPARQL-QUERY and SPARQL-UPDATE. What other types I could see in SPRARQL? And I am looking for a syntax where I can replace a particular element property with a new value. But, using insert query, I can only see that the new value is being added as additional value of the property instead of replacing the whole values of the property. So, is there any other language for this purpose, like sparql-update something? Also, I can see that delete

Why filter doesn't work in this context?

孤人 提交于 2019-12-12 20:57:19
问题 This is the query and the result: As you see, I am filtering out the users that are bo:ania , so why do they still appear? However, if I remove the widecard and select just the users ?user , bo:ania doesn't appear I didn't provide a minimum data example because this is a question about how filter and wildcard work, not about a problem in extracting some data from a data set. However, if you need a minimum data, I'm more than happy to provide it. 回答1: ?specificUser is bound to bo:ania by your