semantic-web

How to retrieve XML/RDF data from a dbpedia link or URL?

血红的双手。 提交于 2019-12-30 07:13:01
问题 Recently I have been trying to learn Semantic Web. For a project I need to retrieve data from a given dbPedia link. e.g http://dbpedia.org/page/Berlin . But when retrieve data using java.net.URLConnection I get the html data. How can I get the xml from the same link ? I know that there is link in every dbpedia page to download the XML but that is not what I want to do. Thanks in advance. 回答1: Note that the URI of the resource is actually http://dbpedia.org/resource/Berlin (with resource , not

“method not allowed” in a python function for flask

我与影子孤独终老i 提交于 2019-12-25 11:54:32
问题 I want to save on a .ttl file a type 'person' resource from a javascript function: this is my sparql query: @app.route('/registraAnnotatore/<author>+<mail>', methods=['POST']) def registraAnnotatore(author,mail): sparql = SPARQLWrapper("http://localhost:3030/data/update") mailto = "<mailto:"+mail+">" sparql.setQuery(""" PREFIX aop: <http://vitali.web.cs.unibo.it/AnnOtaria/person/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX schema: <http://schema.org/> INSERT DATA { """+mailto+""" a foaf

SPARQL - select from skos:category - Virtuoso 37000

▼魔方 西西 提交于 2019-12-25 08:39:35
问题 I have problem with SPARQL. I want to select something from category. For example subjects. I make query like this in http://dbpedia.org/snorql. SELECT ?category ?subject WHERE { ?category a skos:Concept . ?category skos:Concept: American_punk_rock_guitarists. ?category dct:subject ?subject . } LIMIT 1000 I have error Virtuoso 37000. I don't understand why. P.S. Is it good book for beginnier in SPARQL - Learning SPARQL, 2nd Edition Querying and Updating with SPARQL 1.1 ? 回答1: You have at

Link object to subject in RDF domain

非 Y 不嫁゛ 提交于 2019-12-25 07:33:20
问题 I have this RDF file: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://relation/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <rdf:Description rdf:about="soggetto"> <j.0:Nome>Vercelli</j.0:Nome> <j.0:Regione>Piemonte</j.0:Regione> </rdf:Description> <rdf:Description rdf:about="Piemonte"> <rdfs:label>Piemonte</rdfs:label> </rdf:Description> <rdf:Description rdf:about="Regione"> <rdfs:label>Regione</rdfs:label> <rdf:type rdf:resource="http://www.w3.org

Stardog data loading and Jena

☆樱花仙子☆ 提交于 2019-12-25 06:28:55
问题 I am using Stardog to store a bunch of triples that come from different sources. I use Jena to collect and merge the data in a single Jena graph. All these triples are part of ABoxes. I am not sure Stardog will require that the TBox is also merged with the ABox graphs. I supposed it does because otherwise I cannot see how Stardog will do reasoning over the data. I have not seen any option to store and use the TBox apart as in some others triple stores. Do I need to include the TBox in the

Stardog data loading and Jena

有些话、适合烂在心里 提交于 2019-12-25 06:27:10
问题 I am using Stardog to store a bunch of triples that come from different sources. I use Jena to collect and merge the data in a single Jena graph. All these triples are part of ABoxes. I am not sure Stardog will require that the TBox is also merged with the ABox graphs. I supposed it does because otherwise I cannot see how Stardog will do reasoning over the data. I have not seen any option to store and use the TBox apart as in some others triple stores. Do I need to include the TBox in the

Loading a .trig file into TDB?

霸气de小男生 提交于 2019-12-25 04:07:03
问题 I am currently writing some code in Java, using Jena and TDB -- on a Windows 7. I want to be able to load a (large) .trig file into TDB Dataset so that querying is a bit faster. The code that I currently have is: Dataset dataset = TDBFactory.createDataset(directoryPath); Model tdb = dataset.getDefaultModel(); RDFDataMgr.read(tdb, inputFilePath); try { String theQuery = readFile(testQueryPath, Charset.defaultCharset()); Query query = QueryFactory.create(theQuery); QueryExecution qe =

How to write Jena rule to query class and get individuals for a property

久未见 提交于 2019-12-25 01:15:00
问题 How to extract all actuators that are switched off when there are no users at home. I tried to write Jena rule but am unable to get proper output. I have added desired result that I want. Need help with writing rule. [rule1: noValue(:users :hasLocation :home) -> (:actuators :hasLocation :home) (:actuators :state "OFF"^^xsd:boolean)] [rule2: noValue(:users :hasLocation :home) -> (?x rdf:type :actuators) (?x :hasLocation :home) (?x :state "OFF"^^xsd:boolean)] { rulex: [noValue(:subject1

Converting Websites in HTML/XML into RDF [closed]

空扰寡人 提交于 2019-12-24 22:17:35
问题 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 6 years ago . I want to convert the data on any html website to rdf. do you know any html to rdf converter? or, do you recommend for this purpose the use of XQuery or GRDDL? 回答1: In general, an automatic conversion is not possible, since HTML says what something looks like, and not what it means. If the HTML contains existing

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