rdf

how to use cidoc-crm in jena

别来无恙 提交于 2019-12-23 01:11:36
问题 Recently, I'm trying to approach semantic web using Jena to create RDF and make query. Now, I have successfully made a owl based RDF file in Jena. However, when I trying to use different ontologies (such as: cidoc-crm), I do not know how to import those ontologies to Jena. Does anyone know how to import them to Jena? Do I need to create a new ontology model? 回答1: Jena's OntModel interface provides a convenient way of working with ontologies (including RDFS ontologies). The following code

OWL instance participation logic

时间秒杀一切 提交于 2019-12-23 00:52:32
问题 In OWL: There is a class X and the properties P1, P2, and P3, each of which has domain X. I want to say: Every instance of X must at least participate in a relation with one of the properties P1 or P3. Every instance of X which participates in a relation with P2 must also participate in a relation with P1. But every instance of X may only participate in relations with P1 and P2 or in relations with P3. Maybe it is easier to understand with some syntax and labels: :Chronology a owl:Class ;

Difference between rdf:seeAlso and rdfs:seeAlso

元气小坏坏 提交于 2019-12-22 18:02:12
问题 What is the difference between rdf:seeAlso and rdfs:seeAlso ? When I can use rdf:seeAlso and when I can use rdfs:seeAlso ? Can you do any examples? 回答1: First, note that rdf and rdfs are prefixes commonly used to reference the RDF syntax and RDF schema vocabularies respectively. The rdf is typically used for http://www.w3.org/1999/02/22-rdf-syntax-ns#, so that rdf:seeAlso would expand to http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso. However, if you follow the vocabulary reference, you

SPARQL to get all parents of all nodes

戏子无情 提交于 2019-12-22 13:07:12
问题 I have been using this post to get the parents or lineage of a single RDF node: SPARQL query to get all parent of a node This works nicely on my virtuoso server. Sorry, couldn't find a public endpoint containing data with a similar structure. prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix bto: <http://purl.obolibrary.org/obo/> select (group_concat(distinct ?midlab ; separator = "|") AS ?lineage) where { bto:BTO_0000207 rdfs:subClassOf* ?mid . ?mid rdfs:subClassOf* ?class . ?mid

Resolve asynchronous function of Graphql not able to return data queried over Stardog server having rdf data

五迷三道 提交于 2019-12-22 12:40:50
问题 I am trying to query a stardog server using graphql below is my code. import { GraphQLSchema, GraphQLObjectType, GraphQLInt, GraphQLString, GraphQLList, GraphQLNonNull, GraphQLID, GraphQLFloat } from 'graphql'; import axios from 'axios'; var stardog = require("stardog"); let Noun = new GraphQLObjectType({ name: "Noun", description: "Basic information on a GitHub user", fields: () => ({ "c": { type: GraphQLString, resolve: (obj) => { console.log(obj); } } }) }); const query = new

Convert JSON file into RDF format using Java

若如初见. 提交于 2019-12-22 11:18:49
问题 Here I want to convert the JSON file into RDF. Here is the JSON { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } } I could not find a proper way to

Merging multiple RDF documents into one

北城以北 提交于 2019-12-22 11:04:58
问题 I have got two RDF documents: http://dublincore.org/2012/06/14/dcterms.rdf http://xmlns.com/foaf/spec/index.rdf I would like to merge them into one file, e.g., purl_foaf.rdf . I am working in Java; how can I do this with Jena? 回答1: Jena has a built-in command line utility to do this: rdfcat. So, to join those two RDF files together and write the results as Turtle in the file purl_foaf.rdf , do the following from your command line. It should be on one line, but I've split it up for readability

Generate Graph with sub-Graphs using sparql

偶尔善良 提交于 2019-12-22 10:37:40
问题 I have the following situation in my RDF-store: Named Graph: A S1 P1 O1 Named Graph: B S2 P2 O1 Named Graph: C S3 P3 O1 I now want to define a SPARQL Query which finds all Graphs where O1 is in the tripples, and stores those 3 Graphs + the tripples in a new Graph with the name A+B+C NEW Named Graph: A+B+C Named Graph: A S1 P1 O1 Named Graph: B S2 P2 O1 Named Graph: C S3 P3 O1 With Construct or insert Into i only found out how to build a graph out of tripples, bzw not how to build a graph

how to convert model checking logic query to SPARQL query?

萝らか妹 提交于 2019-12-22 10:27:01
问题 Suppose I have the following RDF data: @prefix : <urn:ex:> :m :A "a" :m :A "b" :m :A "c" :m :B "a" :m :B "b" What SPARQL query could I use to check whether the RDF model satisfies the following logical formula? ∀x A(X) → B(x) 回答1: SPARQL doesn't have conditionals or universal quantification, but does have existentials (does anything match this?), (implicit) conjunction and negation (in the 'absence' sense). So rewrite the question: ∀x A(x) → B(x) ⇒ ∀x ¬ ( A(x) ∧ ¬ B(x) ) ⇒ ¬ ∃x A(x) ∧ ¬ B(x)

How to validate a RDF with your RDF schema

拟墨画扇 提交于 2019-12-22 08:34:13
问题 I'm using the Jena framework to manipulate RDF files, but I can't find a way to validate a RDF with your respective RDFSchema. I'm trying this method bellow: Model mod1 = new ModelMem(); Model modSchema = new ModelMem(); String baseURI = "http://iec.ch/TC57/2007/network"; String rdfPath = "file:D:\\modelo.rdf"; InputStream model = FileManager.get().open(rdfPath); String rdfPathSchema = "file:D:\\Schema.rdf"; InputStream modelSchema = FileManager.get().open(rdfPathSchema); mod1.read(model,