API Docs for: 1.0.0
Show:

CORE.Ontology Class

General ontology that will contain all the entities, relationships and literals.

Constructor

CORE.Ontology

(
  • name
  • domain
)

Parameters:

  • name String

    Name of the Ontology.

  • domain String

    Domain of the Ontology.

Methods

createEntity

(
  • name
)
Entity

Creates an entity. Called from the Ontology object.

Parameters:

  • name String

    Name of the Entity.

Returns:

Entity:

Returns the created Entity object.

Throws:

CreateEntityException:

Cannot create entity.

Example:

var semantics = new Semant();
var people = semantics.createOntology("People", "http://ppl.com");
var male = ont_people.createEntity("Male");
var female = ont_people.createEntity("Femal");

createLiteral

(
  • value
)
Literal

Creates a literal

Parameters:

  • value Object

    The object of relation to be added.

Returns:

Literal:

Returns the created Relation object.

Throws:

CreateLiteralException:

Cannot create literal.

Example:

var ppl = semantics.createOntology("People", "http://ppl.com");
var male = ppl.createEntity("Male");
var female = ppl.createEntity("Female");
var bornIn = ppl.createRelation("bornIn");
var oguz = male.createSubEntity("Oguz");
var oguzYear = ppl.createLiteral(1993);
oguz.addRelation(bornIn, oguzYear);

createRelation

(
  • relation
)
Relation

Creates a relation.

Parameters:

  • relation String

    The object of relation to be added.

Returns:

Relation:

Returns the created Relation object.

Throws:

CreateRelationException:

Cannot create relation.

Example:

var semantics = new Semant();
var geo = semantics.createOntology("Geo", "http://geo.com");
var in = geo.createRelation("in");

Properties

domain

String

Domain of the ontology where all the URI's will be based on

Default: undefined

entityCollection

Object Entity name, Entity

Default: {}

name

String

Name of the ontology

occupiedURIs

String Array

Keeps every URI created under this ontology. Will be used for uniqueness check.

Default: []

relationCollection

Object Relation name, Relation

Default: {}

type

String

For identifying an instance

URI

String

URI of the ontology