turtle-rdf

Why does this SPARQL query return certain items as subjects?

好久不见. 提交于 2021-01-28 00:35:55
问题 I have the following data graph: @prefix hr: <http://learningsparql.com/ns/humanResources#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix sch: <http://schema.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . hr:Another a rdfs:Class . hr:Employee a rdfs:Class ; rdfs:label "model" ; rdfs:comment "a good employee" . hr:Longer a hr:Employee ; rdfs:label

How do I add a start and end time to a RDF triple?

夙愿已清 提交于 2020-05-28 04:12:48
问题 Supposing we have the following triple in Turtle syntax: <http:/example.com/Paul> <http:/example.com/running> <http:/example.com/10miles> . How do I add a start and end time? For example if I want to say he started at 10 am and finished his 10miles run at 12 am. I want to use xsd:dateTime . 回答1: One way of doing this is through reification - making statements about the statement. Here, you have a choice of giving the statement a URI, so that it's externally dereferenceable, or using a blank

How do I add a start and end time to a RDF triple?

允我心安 提交于 2020-05-28 04:10:13
问题 Supposing we have the following triple in Turtle syntax: <http:/example.com/Paul> <http:/example.com/running> <http:/example.com/10miles> . How do I add a start and end time? For example if I want to say he started at 10 am and finished his 10miles run at 12 am. I want to use xsd:dateTime . 回答1: One way of doing this is through reification - making statements about the statement. Here, you have a choice of giving the statement a URI, so that it's externally dereferenceable, or using a blank

OWL RDF/TTL Make an instance member of class based on property

人走茶凉 提交于 2020-02-03 01:58:21
问题 I am trying to design an ontology that will categorise products based on the products components. In the example below I have a class Ingredient with an instance eggs . I want to add apple_tart to all classes of products that do not contain eggs . So in this case apple_tart will be added to the class GlutenFriendly and NOT VeganFriendly . bakery:VeganFriendly rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :hasIngredient ; owl:hasValue :eggs ] owl:disjointWith

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"

TTL file format - I have no idea what this is

馋奶兔 提交于 2019-12-31 03:58:09
问题 I have a file which has a structure, but I don't know what format it is, nor how to parse it. The file extension is ttl, but I have never encountered this before. Some lines from the file looks like this: <http://data.europa.eu/esco/label/790ff9ed-c43b-435c-b6b3-6a4a6e8e8326> a skosxl:Label ; skosxl:literalForm "gérer des opérations d’allègement"@fr . <http://data.europa.eu/esco/label/98570af6-b237-4cdd-b555-98fe3de26ef8> a skosxl:Label ; esco:hasLabelRole <http://data.europa.eu/esco/label

Loading YAGO Ontology with OWL API

試著忘記壹切 提交于 2019-12-24 05:53:07
问题 I’m using the OWL API (3.4.8 for compatibility reasons) for the first time, and I’m trying to load an ontology that is provided as part of the YAGO knowledge base (http://resources.mpi-inf.mpg.de/yago-naga/yago3.1/yagoSimpleTaxonomy.ttl.7z). However I keep getting the following warning: [main] WARN org.obolibrary.oboformat.parser.OBOFormatParser - LINE: 629693 Expected white space at pos: 44 LINE: <wikicat_Gardens_in_Aomori_Prefecture> rdfs:subClassOf <yagoGeoEntity> . (I just copied one

Ensure that multiple subjects point to same list of blank nodes

自作多情 提交于 2019-12-23 12:19:35
问题 Consider the following instance of SomeClass : instances:some_thing1 a semapi:SomeClass ; semapi:hasChainTo ( [ ... ] [ ... ] [ ... ] ) . I need every instance ( some_thing2 , some_thing3 , etc.) to have its hasChainTo property point at the same list of blank nodes (as in there is only one copy of it). I need to maintain the list of blank nodes syntax because the chains get very deep and this syntax is very fluid for writing out each chain (for SomeClass2 , SomeClass3 , etc.). If I simply

Reading a Turtle/N3 RDF File with Python

假装没事ソ 提交于 2019-12-22 04:17:29
问题 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

How to parse .ttl files with RDFLib?

≯℡__Kan透↙ 提交于 2019-12-20 20:34:13
问题 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