jena

Sparql - Applying limiting criteria to predicates

本秂侑毒 提交于 2019-11-30 09:30:08
问题 I'm fairly new to RDF / Sparql, so apologies for any incorrect terminology, and also for the fairly terrible example that follows: Given the following RDF dataset: @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix e: <http://www.example.com/#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . e:Freemason a owl:Class . e:Civilian a owl:Class . e:Marty a e:Freemason . e:Eugene a e:Freemason . e:Mike a e:Freemason . e:Alan a e

How to write SPARQL query that efficiently matches string literals while ignoring case

我们两清 提交于 2019-11-30 07:25:43
问题 I am using Jena ARQ to write a SPARQL query against a large ontology being read from Jena TDB in order to find the types associated with concepts based on rdfs label: SELECT DISTINCT ?type WHERE { ?x <http://www.w3.org/2000/01/rdf-schema#label> "aspirin" . ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type . } This works pretty well and is actually quite speedy (<1 second). Unfortunately, for some terms, I need to perform this query in a case-insensitive way. For instance, because the

Is there a Java open source implementation of R2RML?

我与影子孤独终老i 提交于 2019-11-30 03:36:56
问题 I want to generate RDF data from tabular data, in particular: CSV, TSV, spreadsheets (either Excel or OpenOffice) and, eventually, tables in RDBMS. I am aware of the "RDB to RDF Mapping Language" (R2RML) (http://www.w3.org/TR/r2rml/) current draft. I use Apache Jena for processing, storing and querying RDF data and/or reading CSV or TSV files. I use Apache POI for reading Microsoft Excel spreadsheets and I am planning to use Apache ODF Toolkit for reading OpenOffice spreadsheets. Is there a

基于本体的语义信息模型的验证方法

情到浓时终转凉″ 提交于 2019-11-29 22:20:13
一、先简单说说整个的一个需求吧 广义的配电管理系统(DMS)涵盖配电网生产、运行和服务全过程,是整个电力企业信息集成系统的一个有机组成部分。DMS 包含着大量应用系统, 由于现在配网一体化和智能化发展的要求,需要这些应用系统之间能够相互的进行数据交换(实现系统间的 互操作 如下图 ),但 这些大量的系统由于开发时间和功能的不一致,造成了这些系统和相应的数据库采用了不同的接口标准和模型,相对独立,不可避免的造成信息重叠和“信息孤岛”,无法实现全局范围内的信息交互和信息共享。 目前,整个电网对此的解决方案是构建基于 SOA 的电力企业服务总线(ESB),它是基于IEC61968提出来的。这种设计为电 力企业的信息集成提供了信息机交互的可能性,从体系架构的级别保证了整个系统的松耦合性和灵活性。IEC 61968 采用基于公共信息模型(Common Information Model,简称 CIM)的消息交换机制,对配电企业中的信息模型进行扩展,包括资产、用户、工作、文档等部分,制定资产管理系统、工作管理系统、施工管理、配电网管理、停电管理等业务功能的接口消息规范 XSD(XML Schema Definition),在消息总线上通过标准消息的传递,实现了各业务功能系统间的数据交互。但在此工程中,出现了如下问题: 1 公共信息模型(CIM)随着需求的不断提升,版本更新频繁

get OWL restrictions on classes using Jena

邮差的信 提交于 2019-11-29 20:43:06
问题 Using the pizza ontology, I want to be able to look up all the toppings for American pizza. If I open the ontology in Protégé, I can see that American pizza has the following restrictions: hasTopping some MozerellaTopping hasTopping some TomatoTopping How can I get the same information programatically through Jena? 回答1: Here's my solution. I've just printed out the strings you ask for, but hopefully you can see from this how to use the Jena OntAPI to traverse an ontology graph and pick out

SPARQL - Insert data from remote endpoint

核能气质少年 提交于 2019-11-29 16:53:37
How can i query a remote endpoint (like endpoints of DBPedia or Wikidata ) and insert resulting triples in a local graph? So far, i know that there are commands like INSERT, ADD, COPY etc. which can be used for such tasks. What i don't understand is how to address a remote endpoint while updating my local graph. Could someone provide a minimum example or the main steps? I'm using Apache Jena Fuseki v2 on Windows and this is my query so far: PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX p: <http://www.wikidata.org/prop/> PREFIX wd: <http://www.wikidata.org/entity/> INSERT { GRAPH <?

Sparql - Applying limiting criteria to predicates

折月煮酒 提交于 2019-11-29 15:36:28
I'm fairly new to RDF / Sparql, so apologies for any incorrect terminology, and also for the fairly terrible example that follows: Given the following RDF dataset: @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix e: <http://www.example.com/#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . e:Freemason a owl:Class . e:Civilian a owl:Class . e:Marty a e:Freemason . e:Eugene a e:Freemason . e:Mike a e:Freemason . e:Alan a e:Freemason . e:Paul a e:Civilian . e:Marty foaf:knows e:Eugene . e:Eugene foaf:knows e:Mike . e:Eugene foaf

RDF list subjects with their objects in a single line

偶尔善良 提交于 2019-11-29 15:21:50
I have an RDF file and I need to extract some information from it and write it to a file. I understood how it basically works, but I'm stuck with this: String queryString = "select ?person ?children where { ?person ?hasChildren ?children}"; TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString); TupleQueryResult result = tupleQuery.evaluate(); while (result.hasNext()) { BindingSet bindingSet = result.next(); Value p1 = bindingSet.getValue("person"); Value p2 = bindingSet.getValue("child"); println(p1 + " has children " + p2 +""); } result.close(); The output I get is

Unresolved prefixed name: rdfs:subClassOf in SPARQL query

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 15:00:46
import java.awt.*; import java.awt.event.*; import java.applet.*; import java.lang.*; import java.util.regex.*; import java.io.*; import com.hp.hpl.jena.sparql.*; import com.hp.hpl.jena.*; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.query.*; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.query.ResultSetFormatter; /* <applet code="Sample" width=275 height=200> </applet> */ /

Fuseki how to add Pellet reasoner

主宰稳场 提交于 2019-11-29 12:41:47
I want to use pellet reasoner with my Fuseki 2.3.1 First: I added Pellet reasoner to my config.ttl as this: ja:reasoner [ ja:reasonerClass "org.mindswap.pellet.jena.PelletReasonerFactory";] So now I have to add the jar for Pellet to fuseki This page explains how to add jars (not specificaly pellete) to fuseki https://jena.apache.org/documentation/permissions/example.html So I commet this line exec $JAVA $JVM_ARGS -jar "$JAR" "$@" and I uncommet this line java $JVM_ARGS -cp "$JAR:$APPJAR" org.apache.jena.fuseki.cmd.FusekiCmd "$@" and uncomment the line that starts with APPJAR= now I still need