This repository contains the files that define the Buddhist Digital Ontology (BDO).
The overall ontology is organized in a collection of directories and files as follows:
Person
may play in events related to Works
, Places
, and other Persons
:Binding
or :Script
of an :Instance
skos:Scheme
s that organize some of the typeshttp://purl.bdrc.io/context.jsonld
.The policy is used with the Jena library to locate components of the ontology and cache them for later use. There are two ways to load an ontology: 1) processing imports; and 2) ignoring imports during loading of an ontology document.
import org.apache.jena.ontology.OntDocumentManager;
import org.apache.jena.ontology.OntModel;
import org.apache.jena.ontology.OntModelSpec;
public class OntExample {
static String bdoNS = "http://purl.bdrc.io/ontology/core/";
static String policyURL = "https://raw.githubusercontent.com/buda-base/owl-schema/master/ont-policy.rdf";
public static void main( String[] args ){
OntDocumentManager ontMgr = new OntDocumentManager( policyURL );
ontMgr.setProcessImports( true ); // default but it doesn't hurt to be explicit
OntModelSpec ontSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
ontSpec.setDocumentManager( ontMgr );
OntModel bdoModel = ontMgr.getOntology( bdoNS, ontSpecImporting );
System.out.println( "bdoModel.size() = " + bdoModel.size() + " triples" );
}
}
The above loads the entire Buddhist Digital Ontology, bdoModel
, into a model which can then be interrogated, inferencing run on it and so on. The reported size is currently 4067 triples.
If you want to just access the bdoNS
document without processing any of the imports defined in the document then ontMgr.setProcessImports( false )
before using the ontMgr
the first time, in which case the reported size currently is 2602 triples
OntDocumentManager
has been accessed via getOntology
(or getModel
) with one setting of processImports
then all future references will use that setting.So if you need both aggregate models (all imports processed) and just the documents, then you need two instances of OntDocumentManager
one with processImports == true
and one with processImports == false
.
See Change log.
Protégé handles only RDF 1.0 while TopBraid Composer and Jena handles RDF 1.1. The files are in RDF 1.1 format. They can be easily converted to RDF 1.0 (handled by Protégé) with:
$ sed 's,http://www.w3.org/1999/02/22-rdf-syntax-ns#langString,http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral' bdo.ttl > bdo-rdf10.ttl
All files, such as bdo.ttl and associated documentation are distributed under the CC0 license.