rdf

Wikidata content negotiation

瘦欲@ 提交于 2020-01-22 00:49:38
问题 I was wondering why Wikidata content negotiation results with more than one entities in the file. For instance P2044 in the browser http://www.wikidata.org/entity/P2044.nt gives me triples also about Q6452016 entity: http://www.wikidata.org/entity/Q6452016 I would expect either triples about P2044 or document metadata. Thanks in advance. 回答1: There are many options of what to produce in an RDF output (as well as there is no standard on what to return in a DESCRIBE query result). In Wikidata,

Representing a couple of RDF-triples using tensor. How to programming this modeling process using Python?

无人久伴 提交于 2020-01-17 12:36:20
问题 A question about representing a couple of RDF-triples using tensor. Scenario: A RDF-triple is used to express simple statements about resources, formatting (subject, predicate, object). Suppose I have two predicates, one is play_for, the other is race_for, each of which contains n triples, as follows: 1-st predicate: play_for; n triples: (Ray Allen, play_for, Boston Celtics), (Kobe Bryant, play_for, Lakers), ... For short, (A_i, play for, T_i) for i =1 to n. 2-rd predicate: race_for; n

Why do we need to use rdf:parseType=“Collection” with owl:intersectionOf?

孤街醉人 提交于 2020-01-17 03:25:19
问题 Conside the following example taken from, http://www.w3.org/TR/owl-ref/#intersectionOf-def. <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Tosca" /> <owl:Thing rdf:about="#Salome" /> </owl:oneOf> </owl:Class> <owl:Class> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Turandot" /> <owl:Thing rdf:about="#Tosca" /> </owl:oneOf> </owl:Class> </owl:intersectionOf> </owl:Class> While we understand

Jena adds path/url to URIs

谁都会走 提交于 2020-01-16 18:41:50
问题 I just started working with RDF and Jena. I got a RDF model which I want to read, modify and write out again. Assume my model file is located at http://xyz/model.ttl and contains an element with URI "someURI". When I do Model model = ModelFactory.createDefaultModel(); model.read("http://xyz/model.ttl", "", "TURTLE"); model.write(System.out, "TURTLE"); the URI in the output changes from "someURI" to http://xyz/someURI . When I read the model from the local filesystem, the URI changes to file:/

Jena adds path/url to URIs

霸气de小男生 提交于 2020-01-16 18:41:13
问题 I just started working with RDF and Jena. I got a RDF model which I want to read, modify and write out again. Assume my model file is located at http://xyz/model.ttl and contains an element with URI "someURI". When I do Model model = ModelFactory.createDefaultModel(); model.read("http://xyz/model.ttl", "", "TURTLE"); model.write(System.out, "TURTLE"); the URI in the output changes from "someURI" to http://xyz/someURI . When I read the model from the local filesystem, the URI changes to file:/

Delete RDF tuple using dotNetRDF [duplicate]

点点圈 提交于 2020-01-16 09:08:10
问题 This question already has answers here : SPARQL delete query dotNetRDF does not modify RDF file (2 answers) Closed 5 years ago . I'd like to delete a RDF tuple using dotNetRDF. Here is my RDF file: <rdf:RDF xml:base="http://www.example.org/destDetails#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:ns0="http://www.example.org/destDetails#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="&ns0;0165a659

Query city/state/country abstracts in English

随声附和 提交于 2020-01-16 00:58:30
问题 I am trying to query city, state and country abstracts in English from DBpedia with mixed results. It seems to work well with City and Country but not with State. SELECT * WHERE { ?x rdfs:label "France"@en. ?x dbpedia-owl:abstract ?abstract. FILTER (LANG(?abstract) = 'en') } Or SELECT * WHERE { ?x rdfs:label "Boston"@en. ?x dbpedia-owl:abstract ?abstract. FILTER (LANG(?abstract) = 'en') } However, these queries don't find any results: SELECT * WHERE { ?x rdfs:label "Sao Paulo"@en. ?x dbpedia

Search by name in rdf/n3 file

五迷三道 提交于 2020-01-15 10:54:29
问题 I have to perform some filtering in a turtle/n3 file, returning another file of the same kind. The basic data element (location) i work on is this: :pt0001 vcard:category "Poste e Telegrafi" ; vcard:fn "Ufficio Bologna 1" ; vcard:extended-address "Via Cairoli 9, Bologna BO, Italy" ; vcard:latitude "44.504192" ; vcard:longitude "11.338661" ; vcard:tel "051 243425" ; vcard:fax "051 244459" ; cs:opening "Mon, Tue, Wed, Thu, Fri: 0800-1330. Sat: 0800-1230." ; cs:closing "01-01, 01-06, P, LA, 04

XML to RDF : using JENA GRDDL

佐手、 提交于 2020-01-15 10:44:12
问题 I want to transform xml files to RDF. I think that JENA GRDDL can be used ,but I don't know how it works ! and I did not found any examples ! can you help me please to start using this API or show me any possible solutions ! 回答1: You can transform XML files to RDF using XSLT, typically targeting RDF/XML (see, e.g., Using jena for creating RDF from XMl file). Jena can then read the resulting file. You can even streamline this process and parse the result of the XSLT transformation directly

UNION and intersection using SPARQL queries

末鹿安然 提交于 2020-01-15 07:22:06
问题 I am converting user-defined-queries into SPARQL. For example, when user says, "abc", it means give me all nodes of a given type which have some attribute named "abc". As an extension of this, if user says, "abc or (pqr and lmn)", I need to find all nodes of a given type for which some attribute is "abc or (pqr and lmn)". Following is the query I have come up with: SELECT DISTINCT ?node, ?type WHERE { { ?node a ?type . FILTER ( ?type != <sometype>) } { { ?node ?reln0 ?obj0 . FILTER ( regex