IntelligentGraph = Tomcat (v9) + RDF4J (v3.7.4) + IntelligentGraph SAIL (v0.9.0)
1.0K
IntelligentGraph is ready-to-go IntelligentGraph sever based on Tomcat (v9) with IntelligentGraph (v0.9.0) enabled RDF4j-Server and RDF4J-Workbench (v3.7.4) preinstalled.
The IntelligentGraph SAIL offers an extended capability for embedded calculation support within any RDF graph. When enabled as an RDF4J SAIL, it offers calculation functionality as part of the RDF4J engine, on top of any RDF4J repository, using a variety of script engines including JavaScript, Jython, and Groovy. It preserves the SPARQL capability of RDF4J, but with additional capabilities for calculation debugging and tracing.
IntelligentGraph includes the PathQL query language. Just as a spreadsheet cell calculation needs to access other cells, an IntelligentGraph calculation needs to access other nodes within the graph. Although full access to the underlying graph is available to any of the scripts, PathQL provides a succinct, and efficient method to access directly or indirectly related nodes. PathQL can either return just the contents of the referenced nodes, or the contents and the path to the referenced nodes.
PathQL can also be used standalone to query the IntelligentGraph-enabled RDF database. This supplements, rather than replaces, SPARQL and GraphQL, as it provides graph-path querying rather than graph-pattern querying capabilities to any IntelligentGraph-enabled RDF database.
One of the easiest ways to get started with IntelligentGraph is to pull the IntelligentGraph docker image from Dockerhub:
docker pull inova8/intelligentgraph
This Docker image contains Tomcat v9 preinstalled, with the following applications pre-installed
IntelligentGraph-enabled repositories can be created using one of the following RDF4J Repository types
Creating an IntelligentGraph-enabled RDF4J repository is no different than any other RDF4J repository, and is well documented here.
The following summarises the essential steps:
Use Add to load a model file (eg example1.ttl, shown below)
http://inova8.com/intelligentgraph/example1/Verify Contexts exists
Verify script with SPARQL Query
PREFIX example1: <http://inova8.com/intelligentgraph/example1>
SELECT *
{
example1:aPerson example1:hasBMI ?BMI, ?BMI_SCRIPT
}
RDF4J also supports a text console application, documented here. This can also be used to create an IntelligentGraph-enabled repository
./console.batconnect http://localhost:8080/rdf4j-serverdrop example1Yescreate native-lucene-intelligentgraphexample1example110000spoc,pocs,cpso,cspo,oscp,ocspopen example1load example1.ttl into file://example1.ttlSince IntelligentGraph combines calculations with the knowledge graph, it is inevitable that any evaluation will involve calls to values of other nodes which are in turn calculations. A trace of a calculation’s execution can be obtained via SPARQL by using a _TRACE postfix to the calculated script variable name.
For example the following SPARQL will retrieve the calculated value and the trace (as structured HTML)
PREFIX example1: <http://inova8.com/intelligentgraph/example1/>
SELECT *
{
example1:aPerson example1:hasBMI ?bmi, ?bmi_TRACE, ?bmi_SCRIPT
}
A simple model of persons, with one example. TYhe person has height and weight properties, but also a calculated BMI index.
# baseURI: http://inova8.com/intelligentgraph/example1/
# prefix: example1
@prefix : <http://inova8.com/intelligentgraph/example1/> .
@prefix example1: <http://inova8.com/intelligentgraph/example1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix script: <http://inova8.com/script/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
example1:
a owl:Ontology ;
.
example1:Person
a owl:Class ;
rdfs:label "Person" ;
.
example1:aPerson
a example1:Person ;
example1:hasBMI "double height=_this.getFact(':hasHeight').doubleValue(); _this.getFact(':hasWeight').doubleValue()/(height*height)"^^script:groovy ;
example1:hasHeight 1.7 ;
example1:hasWeight "62"^^xsd:decimal ;
.
example1:hasBMI
a owl:DatatypeProperty ;
.
example1:hasHeight
a owl:DatatypeProperty ;
.
example1:hasWeight
a owl:DatatypeProperty ;
.
Content type
Image
Digest
Size
888.2 MB
Last updated
over 4 years ago
docker pull inova8/intelligentgraph