semantic-web

Splitting .ttl or .nt file - Spark Scala

你离开我真会死。 提交于 2019-12-11 09:02:08
问题 I'm new to scala and I need to read line by line a ttl file and split on particular delimiter and extract values to put in respective columns in dataframe. < http://website/Jimmy_Carter> <http://web/name> "James Earl Carter, Jr."@ko . < http://website/Jimmy_Car> <http://web/country> <http://website/United_States> . < http://website/Jimmy_Car> <http://web/birthPlace> <http://web/Georgia_(US)> . I want to have this output +-------------------------------+---------------------------+------------

Where I can find some rdf and some sparql queries to practise to write in sparql?

柔情痞子 提交于 2019-12-11 08:53:58
问题 I am trying to practice myself in writing some SPARQL queries. Does anybody know where I can find the best material? Where I can find some RDF file and some tasks to try to write my own SPARQL queries. I am good with SQL, and I just need some material to learn to write in SPARQL. 回答1: All sample RDF and queries from the O'Reilly book "Learning SPARQL" are available on the book's home page at learningsparql.com. (Full disclosure: I wrote it.) 回答2: data.gov and DataHub have a lot of

Sparql query containment result

匆匆过客 提交于 2019-12-11 07:35:40
问题 Not familiar with semantic web, under the following context: // owl in terms of Java-like syntax Class Person {} Class GraduateStudent extends Person {reference takesCourse [*] : GraduateCourse} Class Student intersect Person {reference takesCourse [*] : Course} Class UndergradStudent extends Student {} Class Course{} Class GraduateCourse extends Course{} Class CsCourse extends Course{} My question is why Q1 ⊑ Q2 does not hold? In particular, if I understand correctly, Q1 select undergraduate

How do I specify options in the SPARQL REST endpoint for MarkLogic?

有些话、适合烂在心里 提交于 2019-12-11 06:33:31
问题 When I query the SPARQL endpoint for marklogic, I am trying to specify the optimize option: /v1/graphs/sparql?options=optimize%3D2 This results in a 400 error: REST-INVALIDPARAM: (err:FOER0000) Invalid parameter: No configured options: optimize=2" What is the correct syntax to specify this and other options? Related: How can I optimize a SPARQL query that returns optional properties? 回答1: See reference for GET /v1/graphs/sparql. There is an "optimize" parameter you can specify. For example:

Handling commas when using a namespace PREFIX in a Sparql WHERE clause

早过忘川 提交于 2019-12-11 06:15:13
问题 I am trying to query the skos:broader property for the DBPedia category "Diseases_of_oral_cavity,_salivary_glands_and_jaws". This category is available at the following URI: http://dbpedia.org/resource/Category:Diseases_of_oral_cavity,_salivary_glands_and_jaws The following query provides the desired output: PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?broaderCategory WHERE { <http://dbpedia.org/resource/Category:Diseases_of_oral_cavity,_salivary_glands_and_jaws> skos:broader

Specifying an intersection with multiple values in a SPARQL query

不羁的心 提交于 2019-12-11 05:46:50
问题 I'm trying to build a query that returns events that have two named participants. The names of these participants are specified using values for the first name and last name. So far, this is the only working solution I have been able to come up with: SELECT ?event WHERE { ?event con:hasParticipant ?personA . ?personA con:hasFirstName "Bob"^^xsd:string . ?personA con:hasLastName "Smith"^^xsd:string . ?event con:hasParticipant ?personB . ?personB con:hasFirstName "The"^^xsd:string . ?personB

How to define a class Road to be equivalent to a set of objects with the same value of hasRoadNumber data property

与世无争的帅哥 提交于 2019-12-11 04:26:09
问题 I defined class RoadSegment and datatype property hasRoadNumber . So, now I want to define class Road and state that a Road is a set of RoadSegments with the same road number. How it can be done? 来源: https://stackoverflow.com/questions/57937212/how-to-define-a-class-road-to-be-equivalent-to-a-set-of-objects-with-the-same-va

How to retrieve the categorical details in wikidata

自古美人都是妖i 提交于 2019-12-11 04:24:22
问题 I have a list of instances as follows. myinstances = ['word2vec', 'tf-idf', 'dijkstra's algorithm'] For each myinstance in the above list, I want to find: 1. What are the other instances of `myinstance`'s category (i.e. only one hop) 2. What are the instances of `myinstance`'s category's category (i.e. two hops) For example, if we consider myinstance = word2vec What are the other instances of myinstance 's category (i.e. only one hop)? As shown in the figure below the other instances of its

visualizing RDF query result

元气小坏坏 提交于 2019-12-11 03:03:24
问题 My SPARQL Query returns a set of results, I want to visualize the Query results using an RDF Visualization algorithm, such that the results are related together and also I retrieve some more info about it. Example: if My domain is Movie industry, and I query about all movies directed by James Cameron, I get about 10 or 11 results, something like, 'The Terminator' 'Rambo: First Blood Part II' 'Aliens' 'The Abyss' 'Terminator 2: Judgment Day ' 'True Lies' 'Titanic' 'Avatar' I want to make a

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