rdf

How to preserve namespace prefixes in a Jena TDB dataset?

丶灬走出姿态 提交于 2019-12-24 16:54:29
问题 I am using Jena TDB (1.1.1) to store a set of named graphs. Everything works fine but whenever I retrieve a named graph from the the dataset, all the namespace prefix information is lost. Is there a way to preserve the namespace prefixes in the original RDF graph. Following code snippet shows the issue. @Test public void testPreserveNsPrefixes(){ String modelText = "@prefix ro: <http://purl.org/wf4ever/ro#> ." + "@prefix ore: <http://www.openarchives.org/ore/terms/> ." + "@prefix ldp: <http:/

Incremental dataload into Jena from multiple files

风格不统一 提交于 2019-12-24 15:34:30
问题 I want to use tdbloader2 to load multiple files into a TDB datastore. The first one goes fine, but any subsequent loads seem to delete the data that was loaded from previous files. How do I avoid this? 回答1: tdbloader (not tdbloader2) will incrementally load data. tdbloader2 only works for an empty store. Both accept multiple files as well. Or you can use the SPARQL Update to add data. Or you can use the SPARQL Graph Store Protocol with Fuseki to add data. 回答2: It turns out that tdbloader2

Summer in Greece, vol.2

早过忘川 提交于 2019-12-24 14:28:43
问题 Following this qeustion: Summer in Greece with SPARQL, since my memory runs out when executing this query, I would like to constrain the query between two regional units, but I can't group them: SELECT * #?municipality (?bwCount1+?bwCount2 as ?bwCount) WHERE { { SELECT (COUNT(?bw) as ?bwCount1) WHERE { ?regional_unit geo:έχει_επίσημο_όνομα "ΠΕΡΙΦΕΡΕΙΑΚΗ ΕΝΟΤΗΤΑ ΗΡΑΚΛΕΙΟΥ" . ?municipality1 geo:ανήκει_σε ?regional_unit . ?municipality1 geo:έχει_γεωμετρία ?geometry . ?bw geos:hasGeometry ?bw_geo

Select DBpedia resource with at least N occurrences of seleted word in abstract?

我与影子孤独终老i 提交于 2019-12-24 13:55:59
问题 I have this request that results some DBpedia resources and their abstracts. How can I filter the results to get just the resources whose abstracts contain at least a certain number of occurrences of a particular word? PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dbpedia-owl:<http://www.dbpedial.org/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> select distinct ?resource ?url ?resume where { ?resource rdfs:label ?Nom.

Querying DBPedia for entities having a given set of properties

强颜欢笑 提交于 2019-12-24 13:26:14
问题 I have a list of somewhere between 5 and 100 properties and want to query for any entities having these properties (not interested in the values), ranged by most matches. How can this be achieved with a SPARQL query? For instance, say I have the following properties: dbpedia-owl:country dbpedia-owl:elevation dbpedia-owl:leader dbpprop:area dbpprop:flag dbpprop:name … The query should return all resources having values for all of these these properties, as well as resources that match just

RDFLib Blank Node Printing

早过忘川 提交于 2019-12-24 09:39:37
问题 I have an RDF dataset where triples are stored in N-Triples format like follows: <http://ebola.ndssl.bi.vt.edu/country/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ebola.ndssl.bi.vt.edu/vocab/country> . _:AmapX3aXcountryX5fXcountryX5fXnameX5fXclassMapX40XX40X1 <http://ebola.ndssl.bi.vt.edu/vocab/hasValue> "Guinea" . I want to do some processing with the blank nodes. I am writing a program to reading this file in Python. I am using Python RDFLib library. After reading the file,

sparql DESCRIBE query to get data about linked objects

╄→尐↘猪︶ㄣ 提交于 2019-12-24 08:47:09
问题 I have defined a rdf class for Books. Another rdf class for describing people. The Book class contains authoredBy field which links book instances to people instances. Properties of Book Book -Id -name -authoredBy Person -id -firstName -LastName -designation For retrieving book properties, i use the following sparql query DESCRIBE ?book WHERE { ?book a rdf:Book ; } I am able to retrieve all the properties belonging to Book using DESCRIBE i.e the predicate , subject and object. However when it

RDF4J Workbench: Why is One SPIN Constructor Very Slow?

女生的网名这么多〃 提交于 2019-12-24 08:00:36
问题 I apologize for the length of this posting. I am trying to make this slow rule issue reproducible. I'm using TopBraid Composer FE to create an RDF file with ontology and SPIN constructors. He purpose of the SPIN constructors is to check for compliance in the instantiations of individuals of classes defined in the ontology. I find that the execution of the SPIN constructor is very slow, and I'd like to know why. Ontology Including SPIN Constructors SXXIComplianceCheck18.rdf I Modify/Clear my

Do I really need OWL reasoning?

让人想犯罪 __ 提交于 2019-12-24 08:00:28
问题 I recently asked a question about the feasibility of loading about 10 million statements into a triplestore with OWL reasoning enabled. That has lead to some StackOverflow comments as well as discussion within my research group about whether or not we really need OWL reasoning. I'll start with a real-world query that doesn't seem to require OWL reasoning. "41167-4120-0" is the NDC Code that identifies the commercial drug product "Fexofenadine hydrochloride 180 MG Oral Tablet [Allegra]" in the

OWL intersection vs union

∥☆過路亽.° 提交于 2019-12-24 07:37:44
问题 Given the following triples, are the domain and range a union or intersection or something else? <http://www.stackoverflow.com/questions/ask> rdfs:domain <http://stackoverflow.com/questions/tagged/rdf> . <http://www.stackoverflow.com/questions/ask> rdfs:domain <http://stackoverflow.com/questions/tagged/owl> . <http://www.stackoverflow.com/questions/ask> rdfs:domain <https://www.w3.org/TR/owl-ref/#Boolean> . <http://www.stackoverflow.com/questions/ask> rdfs:range <http://stackoverflow.com