sparql

generate an urn/iri/uri dynamically

倾然丶 夕夏残阳落幕 提交于 2019-12-12 16:16:17
问题 I need to generate dynamically the name of a graph depending on the time. I've tough that some think like select ?g where { bind(concat("<urn:myNewGraph_",str(now()),">") as ?g) } would have done the trick, but with Stardog I get a null result. If instead I run this select ?g where { bind(concat("urn:myNewGraph_",str(now())) as ?g) } i get urn:myNewGraph_2015-05-28T09:37:11.823Z Any Ideas? moreover I'm not sure that even if i can get somehow a string like <urn:myNewGraph_2015-05-28T09:37:11

Calculate the depth of subclass in the OWL ontology

删除回忆录丶 提交于 2019-12-12 14:44:10
问题 I'm looking for a SPARQL query that could return the position of specified subclass in the OWL hierarchy. I have studied several examples but the best result I could ever reach is the computation the relative paths between the specified superclass and its subclasses (thanks to Joshua Taylor). Instead of that I need to calculate the "absolute" depth for a given subclass. My ontology contains several top-level classes and every of them is followed with a separate tree of subclasses. Here is

Alternatives to SPARQL query with lots of UNIONs

让人想犯罪 __ 提交于 2019-12-12 14:23:12
问题 I have some named graphs stored in Virtuoso, and I want to find the one that matches the highest number of terms from a provided list. My query is constructed programatically and looks like this: SELECT DISTINCT ?graph (count(DISTINCT ?match) as ?matches) WHERE { GRAPH ?graph { {?match rdf:label "term 1"} UNION {?match rdf:label "term 2"} UNION {?match rdf:label "term 3"} ... } } ORDER BY DESC(?matches) Each term becomes another UNION clause. Is there a better way to do this? The query gets

How to enrich places with geonames ID

ぃ、小莉子 提交于 2019-12-12 13:15:32
问题 I have a list of places which I would enrich with the IDs from geonames. Since geonames by default it's embedded into WikiData I chose to go directly via SPARQL using WikiData endpoint. My workflow: I have imported the excel file into OpenRefine and created a new project In OpenRefine I have created my graph, then I have downloaded it as RDF/XML. Here a snapshot: <rdf:Description rdf:about="http://localhost:3333/0"> <rdfs:label>Aïre</rdfs:label> <crm:P1_is_identified_by>5A1CE163-105F-4BAF

Fuseki 1.0.1 SPARQL Update returns 404

大兔子大兔子 提交于 2019-12-12 12:33:16
问题 I'm trying to learn to update data in Fuseki, but when I try I get a 404 error. I am clearly not doing something right. Perhaps it is my INSERT command? I've tried a ton of them though. I am using the web based SPARQL interface at /sparql.tpl. I can get SPARQL Queries to work on that same page just fine. But the second form, labeled SPARQL Updates is what I'm using for my update, and that gives me errors: PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX booklet: <http://www

Recover the “original” order

我只是一个虾纸丫 提交于 2019-12-12 10:19:50
问题 I am trying to recover the cast list for movies from wikidata. My sparql query for Dr. No is as follows: SELECT ?actor ?actorLabel WHERE { ?movie wdt:P161 ?actor . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } FILTER(?movie = wd:Q102754) } LIMIT 1000 I can try it out at query.wikidata.org but the results are not in the order that I want. It gives 'Sean Connery', 'Zena Marshall', 'Ursula Andress'. The database has the data in the required order as you can see from https:/

Using SPARQL to query DBPedia Company Information

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 10:06:25
问题 I'm trying to query DBPedia using SPARQL only to find company information such as a description, and a logo. I'm rather lost with devising the SPARQL Query to do this. SELECT DISTINCT ?subject ?employees ?homepage WHERE { ?subject rdf:type <http://dbpedia.org/class/yago/Company108058098> . ?subject dbpedia2:numEmployees ?employees FILTER ( xsd:integer(?employees) >= 50000 ) . ?subject foaf:homepage ?homepage . } ORDER BY DESC(xsd:integer(?employees)) LIMIT 20 I have come across the above

Error with SPARQL on Rstudio

我的未来我决定 提交于 2019-12-12 10:05:29
问题 I'm using the sparql package in Rstudio, to query OMIM through bio2rdf. I have tested my query in yasgui and it works correctly. But from Rstudio he returns the following error: > qde <- SPARQL(endpoint,query) Opening and ending tag mismatch: hr line 5 and body Opening and ending tag mismatch: body line 3 and html Premature end of data in tag html line 1 Error: 1: Opening and ending tag mismatch: hr line 5 and body 2: Opening and ending tag mismatch: body line 3 and html 3: Premature end of

Jena Fuseki assembler file + TDB + OWL reasoner

末鹿安然 提交于 2019-12-12 09:02:24
问题 I am having a problem configuring Jena Fuseki using an assembler file. Up until recently I had been starting the server from the command line as follows: sudo ./fuseki-server --loc=la --port=3032 --update /ds This creates a persistent TDB store located in the directory SERVER_ROOT/la. The server starts correctly and displays the following output: 14:30:55 INFO TDB dataset: directory=la 14:30:55 INFO Dataset path = /ds 14:30:55 INFO Fuseki 1.0.1 2014-01-18T19:01:20+0000 14:30:55 INFO Started

Measuring distances among classes in RDF/OWL graphs

时光怂恿深爱的人放手 提交于 2019-12-12 08:48:46
问题 Maybe someone could give me a hint. Is it possible to measure the distance between 2 concepts/classes that belong to the same ontology? For example, let's suppose I have an ontology with the Astronomy class and the Telescope class. There is a link between both, but it is not a direct link. Astronomy has a parent class called Science, and Telescope has a parent class called Optical Instrument which belongs to its parent called Instrumentation, that is related to a class called Empirical