Can Stardog ingest OBDA files for creating vkg mappings?

Can Stardog ingest Ontop OBDA files for VKG mapping definitions?

I searched for obda on https://docs.stardog.com/, and came up dry .. But I figured I'd ask .. if only to maybe get this on a list of possible future enhancements.

Here is a description of the OBDA file format: ObdaFileFormat - ontop/ontop GitHub Wiki. It looks like it's sort of a composite TTL document. In any case, I included an example below.

I'm guessing that the answer is going to be that there is currently no support for OBDA format .. which is not a problem. I think that I can either write an SMS2 generator, or I can use Protégé's Ontop reasoner to ingest OBDA, and then export the mappings as an R2RML file

FWIW, the interest here is driven by the fact that I'm working on a POC that includes a demo of generating a VKG from metadata exported from our Benchling applications .. and automatic generation of triple maps is part of the that demo. The POC is using Ontop (with Protégé as the development environment), and Stardog (obviously with SD studio etc as the basic tools). I happened to get started with Protégé/Ontop as the main tool for developing the mapping strategy .. and haven't had a compelling reason to switch horses yet.

A big part of the reason that I'm able to stick with the "older horse" is that both platforms seem to excel at handing standard interchange formats. As a result I have been able, so far, to build one "meta-mapping" tool to generate files, and then deploy working VKGs on two fairly different platforms by simply ingesting those files.

OBDA file example

[PrefixDeclaration]
:		http://example.com#
owl:		http://www.w3.org/2002/07/owl#
rdf:		http://www.w3.org/1999/02/22-rdf-syntax-ns#
xml:		http://www.w3.org/XML/1998/namespace
xsd:		http://www.w3.org/2001/XMLSchema#
foaf:		http://xmlns.com/foaf/0.1/
obda:		https://w3id.org/obda/vocabulary#
rdfs:		http://www.w3.org/2000/01/rdf-schema#

[MappingDeclaration] @collection [[
mappingId	get example
target		:{id} a :example ; :data#id {id} ; :data#name {name$} ; :data#creation_time {created_at$} . 
source		SELECT id, source_id, schema, "archived$", "archive_purpose$", "creator_id$", "created_at$", "modified_at$", "name$", "schema_id$", "barcode$", "location_id$", "url$"
			   FROM someResource.example;
]]

As part of our POC, I managed to create a conversion engine that can analyze metadata from our applications and generate a pretty large OBDA file, w/ 530 templates.

After importing this OBDA file into Ontop's Protégé add-in, I was then able to export it as R2RML The idea is to then import the R2RML into Stardog. While I haven't done this last step, I expect that it will work just fine.

In any case, it was particularly easy to create a tool that could generate OBDA files. It seemed a good bit easier to create an OBDA generator than to create a generator for R2RML or SMS2.

I kind of like this approach, at least for now, for two reasons:

  • the ease with which I can generate mappings on OBDA format
  • and the fact that I can use this one generator to produce an essentially complete VKG "specification" (in the form of an OWL/TTL file for the ontology, and an OBDA mapping file to populate the triples ), and then use that spec to stand up Ontop VKG server (say, for "in lab use") and a matching Stardog VKG for inclusion in an enterprise-level "KG forest".

Once you create a virtual graph with the R2RML mappings you can export those mappings in SMS2 format: stardog-admin virtual mappings -f sms2 <vgname>

-Paul

1 Like