Skip to content

πŸ’­ A proof of concept for semantic versioning based on an OSTRICH store

License

Notifications You must be signed in to change notification settings

rdfostrich/semantic-ostrich

Folders and files

NameName
Last commit message
Last commit date

Latest commit

16ea88d Β· Apr 29, 2020

History

43 Commits
Nov 6, 2018
May 18, 2018
May 18, 2018
Oct 26, 2017
Oct 26, 2017
Apr 29, 2020
May 15, 2018
Mar 13, 2020
May 15, 2018
May 18, 2018
Oct 30, 2018
Nov 6, 2018
Mar 13, 2020
Nov 6, 2018

Repository files navigation

Semantic OSTRICH

Build Status npm version

This is a prototypical proof-of-concept implementation for semantic versioned querying. It is implemented on top of the versioned triple store, OSTRICH. An additional layer is able to perform inferencing based on a set of rules.

Run on command line

This package ships with a command line tool to execute semantic triple pattern queries against OSTRICH dataset and language stores, based on a set of inference rules.

The following executes a semantic version materialization on dataset version 88 and language version 0 for the triple pattern <http://dbpedia.org/resource/Doctor_Who_(series_9)> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o. This will use the N3 rules from rules.n3.

$ semantic-ostrich bin/semantic-ostrich data/evalrun-bearb-day-data.ostrich/ data/evalrun-bearb-day-language.ostrich/ rules.n3 --vd 88 --vl 0 --qvm '<http://dbpedia.org/resource/Doctor_Who_(series_9)> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o'

For example, a rules file could contain this:

{
  ?c <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?d.
  ?x a ?c.
} => {
  ?x a ?d.
}.

For more information on the command line tool, call semantic-ostrich --help.

Use in an application

// Initialize
const SemanticOstrich = require('semantic-ostrich');
ostrichStore = new SemanticOstrich();
await ostrichStore.init('path/to/datastore.ostrich', 'path/to/languagestore.ostrich', true); // The last parameter sets it to the more performant readonly mode
const rules = SemanticOstrich.readRules('path/to/rules.n3');

// Query one version
const subject = 'http://dbpedia.org/resource/Doctor_Who_(series_9)';
const predicate = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';
const object = null; // variable
triples = await ostrichStore.semanticSearchTriplesVersionMaterialized(rules, subject, predicate, object, { version: 88 }, { version: 0 });

See bin/semantic-ostrich for a more extensive example of the usage of SemanticOstrich.

License

This software is written by Ruben Taelman.

This code is copyrighted by Ghent University – imec and released under the MIT license.

About

πŸ’­ A proof of concept for semantic versioning based on an OSTRICH store

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published