turtle-rdf

Jena read from turtle fails

…衆ロ難τιáo~ 提交于 2019-12-19 08:05:31
问题 I have just imported jena libraries to eclipse to work on rdf-s and it is my first try, but I cannot read a turtle (.ttl) file. I tried it in the following way: import java.io.*; import java.util.*; import com.hp.hpl.jena.rdf.model.*; public class Simpsons { public static void main(String[] args) throws IOException { Model model=ModelFactory.createDefaultModel(); model.read(new FileInputStream("simpsons.ttl"),null); } } The error I get is the following: Exception in thread "main" org.apache

List in front of the expression in OWL?

懵懂的女人 提交于 2019-12-13 18:22:33
问题 Is it possible to have a list in front of an expression in OWL? Something like: ( :Dairy :Egg :Nut ) rdfs:subClassOf :FoodGroup . or: :Dairy , :Egg , :Nut rdfs:subClassOf :FoodGroup . Or in general, is there a syntactic sugar for a group of expressions of the type?: :Diary rdfs:subClassOf :FoodGroup . :Egg rdfs:subClassOf :FoodGroup . :Nut rdfs:subClassOf :FoodGroup . 回答1: Turtle In Turtle, there are no subject lists that would be similar to object lists. It is possible to write something

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

Protege 4 - Saving RDF reformats nested blank nodes

为君一笑 提交于 2019-12-11 19:22:16
问题 I just switched from TopBraid to try out Protege. I have an ontology with some RDF that resembles this: instances:some_thing1 a semapi:SomeClass ; semapi:hasChainTo ( [ a semapi:SomeOtherClass ; semapi:hasChainTo ( [ ... ] [ ... ] ) ] ) . The idea is that this nested blank nodes syntax works great because the chains get very deep and this syntax is fluid and highly readable and maintainable as the chains may change from time to time and new chains can be added. Not only that, but I have

RDF - Distributing rdf:type to all items in the list

自作多情 提交于 2019-12-11 02:46:32
问题 Consider the following RDF: semapi:BaseClass a rdfs:Class; rdfs:subClassOf rdfs:Class . semapi:hasChainTo a rdf:Property; rdfs:domain semapi:BaseClass; rdfs:range semapi:BaseClass . semapi:DerivedClass a rdfs:Class; rdfs:subClassOf semapi:BaseClass . instances:Instance1 a semapi:DerivedClass; semapi:hasChainTo ( [ a semapi:DerivedClass; semapi:hasChainTo ( [C1] [C2] ) ] ) If semapi:hasChainTo rdfs:range semapi:BaseClass then it implies the list is rdf:type semapi:BaseClass . What I really

Wikidata on local Blazegraph : Expected an RDF value here, found '' [line 1]

吃可爱长大的小学妹 提交于 2019-12-11 01:26:01
问题 We (Thomas and Wolfgang) have installed locally wikidata and blazegraph following the instruction here : https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/getting-started.md The mvn package command was successful [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] parent ............................................. SUCCESS [ 54.103 s] [INFO] Shared code ........................................ SUCCESS [ 23.085 s

Meaning of square brackets “[]” when querying RDF with SPARQL?

风格不统一 提交于 2019-12-06 02:46:45
问题 I am pretty new to SPARQL and RDF and I was wondering what exactly does the below mean in SPARQL? [] vc:n ?vcard . The complete query is PREFIX vc: <http://www.w3.org/2006/vcard/ns#> SELECT ?given ?family WHERE{ [] vc:n ?vcard . OPTIONAL {?vcard vc:given-name ?given .} OPTIONAL {?vcard vc:family-name ?family .} } 回答1: This is cannibalized from my answer to What are brackets in SPARQL and why is the linked movie database limited to 2500 records?, of which this question may be a duplicate,

Reading a Turtle/N3 RDF File with Python

我的未来我决定 提交于 2019-12-05 03:32:09
I'm trying to encode some botanical data in Turtle format, and read this data from Python using RDFLib . However, I'm having trouble, and I'm not sure if it's because my Turtle is malformed or I'm misusing RDFLib. My test data is: @PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @PREFIX p: <http://www.myplantdomain.com/plant/description> . p:description a rdfs:Property . p:name a rdfs:Property . p:language a rdfs:Property . p:value a rdfs:Property . p:gender a rdfs:Property . p:inforescence a rdfs:Property . p:color a rdfs

Meaning of square brackets “[]” when querying RDF with SPARQL?

て烟熏妆下的殇ゞ 提交于 2019-12-04 07:11:14
I am pretty new to SPARQL and RDF and I was wondering what exactly does the below mean in SPARQL? [] vc:n ?vcard . The complete query is PREFIX vc: <http://www.w3.org/2006/vcard/ns#> SELECT ?given ?family WHERE{ [] vc:n ?vcard . OPTIONAL {?vcard vc:given-name ?given .} OPTIONAL {?vcard vc:family-name ?family .} } Joshua Taylor This is cannibalized from my answer to What are brackets in SPARQL and why is the linked movie database limited to 2500 records? , of which this question may be a duplicate, although it's a bit more broad. (It asks two questions, whereas this asks just one.) The answer

How to parse .ttl files with RDFLib?

雨燕双飞 提交于 2019-12-03 06:37:52
I have a file in .ttl form. It has 4 attributes/columns containing quadruples of the following form: (id, student_name, student_address, student_phoneno) . (id, faculty_name, faculty_address, faculty_phoneno) . I know how to parse .n3 form triples with RDFLib; from rdflib import Graph g = Graph() g.parse("demo.nt", format="nt") but I am not sure as to how to parse these quadruples. My intent is to parse and extract all the information pertaining to a particular id. The id can be same for both student and faculty. How can I use RDFLib to process these quadruples and use it for aggregation based