rdf

Construct RDF graph on federated query?

雨燕双飞 提交于 2020-01-06 07:27:27
问题 I'm new to SPARQL and RDF. Bascially I have to design federated SPARQL 1.1 query over Wikidata and Dbpedia. Here's my simple query. This will select the films starring Leonardo Di Caprio. PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?film WHERE { { SELECT ?film WHERE { ?film wdt:P161 wd:Q38111.

SPARQL Query to delete all blank nodes with in a Resource

筅森魡賤 提交于 2020-01-06 06:31:27
问题 I am writing a SPARQL query that should delete all triples within in this resource. prefix oslc: <http://open-services.net/ns/core#> prefix example: <http://rdf.company.com/ns/something/net#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dcterms: <http://purl.org/dc/terms/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> example:Resource2 a oslc:ResourceShape ; oslc:describes example:Resource2 ; oslc:property [ a oslc:Property ; oslc:isMemberProperty true ; oslc:name "pgn"

How to include multiple URI's for same property in Jena Model?

你离开我真会死。 提交于 2020-01-06 05:30:06
问题 Hi is there a more efficient way to create the following: .addProperty(RDF.type, locah+"/Repository") .addProperty(RDF.type, DCTerms.Agent) .addProperty(RDF.type, FOAF.Agent); What are the advantages of having a resource with multiple RDF.types? 回答1: Multiple RDF types In computational ontologies, an instance can have multiple classes (types). Classification This can be confusing at first, because for example in medical classification this is different. There you have to choose exactly one

Trouble Inferring Properties for Classes/Individuals in Protege 5/OWL

佐手、 提交于 2020-01-06 03:45:10
问题 I want to be able to infer which ingredients go well together given...their properties and which properties complement each other. I have an ontology like, owl:Thing Ingredient Kale Pear Taste Bitter Sweet owl:topObjectProperty hasTaste tasteComplements goesWellWith Individuals: (*would rather work with just classes) kale a Kale pear a Pear bitter a Bitter sweet a Sweet I've asserted, Kale subClassOf hasTaste some Bitter Pear subClassOf hasTaste some Sweet Bitter subClassOf tasteComplements

Object-to-Triple mapping using AllegroGraph RDF store? [closed]

萝らか妹 提交于 2020-01-06 02:47:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . My project is building a Java web application on top of the AllegroGraph RDF store. I would like to find a good solution to map between the triples that come out of the store and our domain objects. I have looked into Topaz, an Object/Triple mapping API being developed in the spirit of Hibernate. The trouble is

Make filtering people by birthYear and deathYear criteria more performative in SPARQL query

£可爱£侵袭症+ 提交于 2020-01-05 06:17:56
问题 I want to find instances of scientists who both were born and died in prime-numbered years. Building on a previous discussion at this URL, I devised the following query, which is unwieldy and times out: SELECT ?birthYear ?deathYear ?scientist ?scientistLabel WHERE { { select ?value1 { ?number wdt:P31 wd:Q49008. ?number wdt:P1181 ?value1 filter(?value1 < year(now())) } } { select ?value2 { ?number wdt:P31 wd:Q49008. ?number wdt:P1181 ?value2 filter(?value2 < ?value1) } } ?scientist wdt:P106 wd

How to query the distance between two things with SPARQL

南楼画角 提交于 2020-01-04 14:10:53
问题 I created a little metro map with RDF/XML and wonder, how to query the distance between two stops. I'm very new to SPARQL and don't know how to start. "Distance" means, that I want to know, how many stations are between the two ones. Later, I want to calculate the duration, but that's another point. Thats my first approach: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ex: <http://example.com> SELECT (count(?mid) as

Iterate over specific resource in RDF file with Jena

巧了我就是萌 提交于 2020-01-04 06:08:20
问题 I'm using Apache Jena to read a RDF file, which looks like this: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctypes="http://purl.org/dc/dcmitype/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <dcat:Catalog rdf:about="http://uri/"> <dcat:dataset> <dcat

How to specify that a chain of relationships implies another

倖福魔咒の 提交于 2020-01-04 05:54:12
问题 Suppose I'm defining an OWL ontology for family relationships, and I've already defined the relationships "sister-of" and "parent-of". I'd now like to define a relationship "aunt-of" and specify that this relationship is implied by a chain of the other two. In other words: if X "sister-of" Y, and Y "parent-of" Z, then X "aunt-of" Z. Is there a way to do this? It's similar to owl:TransitiveProperty but that obviously doesn't work. It's also in the same general vein as "owl:inverseOf" in terms

Datatype format exception for xsd:dateTime in SPARQL query with Jena?

你离开我真会死。 提交于 2020-01-04 01:58:17
问题 I am trying to apply a range query on a property of the RDF which is of xsd:dateTime format. This is my query: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?x WHERE { ?y <DATE:> ?x . FILTER(?x>"2014-06-05T10:10:10+0530"^^xsd:dateTime) } It gives warning and nothing as result: WARN [main] (Log.java:78) - Datatype format exception: "2014-06-11T12:44:22+0530"^^xsd:dateTime I don't understand what the problem is? I have stored the property in xsd:dateTime format only. 回答1: I have stored