summaryrefslogtreecommitdiff
path: root/src/core/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model')
-rw-r--r--src/core/model/Document.cpp8
-rw-r--r--src/core/model/Document.hpp58
-rw-r--r--src/core/model/Node.hpp4
-rw-r--r--src/core/model/Ontology.cpp (renamed from src/core/model/Domain.cpp)58
-rw-r--r--src/core/model/Ontology.hpp (renamed from src/core/model/Domain.hpp)162
-rw-r--r--src/core/model/Project.cpp6
-rw-r--r--src/core/model/Project.hpp14
-rw-r--r--src/core/model/RootNode.hpp2
8 files changed, 156 insertions, 156 deletions
diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp
index 2fcd20d..fc39348 100644
--- a/src/core/model/Document.cpp
+++ b/src/core/model/Document.cpp
@@ -723,7 +723,7 @@ void Document::doResolve(ResolutionState &state)
if (root != nullptr) {
continueResolveCompositum(root, state);
}
- continueResolveReferences(domains, state);
+ continueResolveReferences(ontologies, state);
continueResolveReferences(typesystems, state);
}
@@ -761,8 +761,8 @@ bool Document::doValidate(Logger &logger) const
void Document::doReference(Handle<Node> node)
{
- if (node->isa(&RttiTypes::Domain)) {
- referenceDomain(node.cast<Domain>());
+ if (node->isa(&RttiTypes::Ontology)) {
+ referenceOntology(node.cast<Ontology>());
}
if (node->isa(&RttiTypes::Typesystem)) {
referenceTypesystem(node.cast<Typesystem>());
@@ -771,7 +771,7 @@ void Document::doReference(Handle<Node> node)
RttiSet Document::doGetReferenceTypes() const
{
- return RttiSet{&RttiTypes::Domain, &RttiTypes::Typesystem};
+ return RttiSet{&RttiTypes::Ontology, &RttiTypes::Typesystem};
}
Rooted<StructuredEntity> Document::createRootStructuredEntity(
diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp
index a5e40ce..dc0f73f 100644
--- a/src/core/model/Document.hpp
+++ b/src/core/model/Document.hpp
@@ -22,29 +22,29 @@
* This header contains the class hierarchy of actual document classes. A graph
* of connected instances of these nodes is a "Document". How the different
* DocumentEntity instances may be connected within the graph is subject to the
- * specification in the respective Domain(s) (see also the Domain.hpp).
+ * specification in the respective Ontology(s) (see also the Ontology.hpp).
*
* A Document, from top to bottom, consists of "Document" instance,
* which "owns" the structural root node of the in-document graph. This might
- * for example be a "book" node of the "book" domain. That root node in turn has
+ * for example be a "book" node of the "book" ontology. That root node in turn has
* structure nodes as children, which in turn may have children. This
* constitutes a Structure Tree. Additionally annotations may be attached to
* Structure Nodes, effectively resulting in a Document Graph instead of a
* Document Tree (other references may introduce cycles as well).
*
- * Consider this XML representation of a document using the "book" domain:
+ * Consider this XML representation of a document using the "book" ontology:
*
* \code{.xml}
* <doc>
* <head>
- * <import rel="domain" src="book_domain.oxm"/>
- * <import rel="domain" src="emphasized_domain.oxm"/>
+ * <import rel="ontology" src="book_ontology.oxm"/>
+ * <import rel="ontology" src="emphasized_ontology.oxm"/>
* <alias tag="paragraph" aka="p"/>
* </head>
* <book>
* This might be some introductory text or a dedication. Ideally, of
* course, such elements would be semantically specified as such in
- * additional domains (or in this one).
+ * additional ontologies (or in this one).
* <chapter name="myFirstChapter">
* Here we might have an introduction to the chapter, including some
* overview of the chapters structure.
@@ -63,9 +63,9 @@
* \endcode
*
* As can be seen the StructureEntities inherently follow a tree structure that
- * is restricted by the implicit context free grammar of the "book" Domain
+ * is restricted by the implicit context free grammar of the "book" Ontology
* definition (e.g. it is not allowed to have a "book" node inside a "section";
- * refer to te Domain.hpp for more information).
+ * refer to te Ontology.hpp for more information).
*
* Another interesting fact is the special place of AnnotationEntities: They are
* Defined by start and end Anchors in the text. Note that this allows for
@@ -114,7 +114,7 @@
#include <core/common/Variant.hpp>
#include "Node.hpp"
-#include "Domain.hpp"
+#include "Ontology.hpp"
#include "RootNode.hpp"
#include "Typesystem.hpp"
@@ -131,7 +131,7 @@ class Anchor;
/**
* A DocumentEntity is the common superclass for StructuredEntities and
- * AnnotationEntities. Similarly to DescriptorEntity in the Domain.hpp it
+ * AnnotationEntities. Similarly to DescriptorEntity in the Ontology.hpp it
* defines that each node in the Document graph may have attributes (in form
* of a struct Variant), and fields.
* The fields here are a vector of vectors. The first vector implements all
@@ -215,7 +215,7 @@ public:
* If the name is unknown an exception is thrown.
*
* @param fieldName is the name of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
* @return a NodeVector of all StructuredEntities in that field.
*/
const NodeVector<StructureNode> &getField(
@@ -243,7 +243,7 @@ public:
* If the index is out of bounds an exception is thrown.
*
* @param idx is the index of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
* @return a NodeVector of all StructuredEntities in that field.
*/
const NodeVector<StructureNode> &getField(const size_t &idx) const;
@@ -257,7 +257,7 @@ public:
*
* @param s is the StructureNode that shall be added.
* @param fieldIdx is the index of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
*/
void addStructureNode(Handle<StructureNode> s, const size_t &fieldIdx);
/**
@@ -271,7 +271,7 @@ public:
*
* @param s is the StructureNode that shall be added.
* @param fieldName is the name of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
*/
void addStructureNode(Handle<StructureNode> s,
const std::string &fieldName = DEFAULT_FIELD_NAME);
@@ -287,7 +287,7 @@ public:
*
* @param ss are the StructureNodes that shall be added.
* @param fieldName is the name of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
*/
void addStructureNodes(const std::vector<Handle<StructureNode>> &ss,
const std::string &fieldName = DEFAULT_FIELD_NAME);
@@ -298,7 +298,7 @@ public:
*
* @param s is the StructureNode that shall be removed.
* @param fieldIdx is the index of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
* @return true if this StructureNode was a child here and false if
* if was not found.
*/
@@ -313,7 +313,7 @@ public:
*
* @param s is the StructureNode that shall be removed.
* @param fieldName is the name of a field as specified in the
- * FieldDescriptor in the Domain description.
+ * FieldDescriptor in the Ontology description.
* @return true if this StructureNode was a child here and false if
* if was not found.
*/
@@ -866,7 +866,7 @@ public:
/**
* A Document is mainly a wrapper for the Root structure node of the Document
- * Graph. It also references the domains that have been used within this
+ * Graph. It also references the ontologies that have been used within this
* document and the AnnotationEntities that span over Anchors in this Document.
*/
class Document : public RootNode {
@@ -874,7 +874,7 @@ private:
// TODO: Might there be several roots? E.g. metadata?
Owned<StructuredEntity> root;
NodeVector<AnnotationEntity> annotations;
- NodeVector<Domain> domains;
+ NodeVector<Ontology> ontologies;
NodeVector<Typesystem> typesystems;
protected:
@@ -893,7 +893,7 @@ public:
Document(Manager &mgr, std::string name)
: RootNode(mgr, std::move(name), nullptr),
annotations(this),
- domains(this),
+ ontologies(this),
typesystems(this)
{
}
@@ -987,30 +987,30 @@ public:
std::string name = "");
/**
- * Returns a const reference to the NodeVector of Domains that are used
+ * Returns a const reference to the NodeVector of ontologies that are used
* within this Document.
*
- * @return a const reference to the NodeVector of Domains that are used
+ * @return a const reference to the NodeVector of ontologies that are used
* within this Document.
*/
- const NodeVector<Domain> &getDomains() const { return domains; }
+ const NodeVector<Ontology> &getOntologys() const { return ontologies; }
/**
- * Adds a Domain reference to this Document.
+ * Adds a Ontology reference to this Document.
*/
- void referenceDomain(Handle<Domain> d)
+ void referenceOntology(Handle<Ontology> d)
{
invalidate();
- domains.push_back(d);
+ ontologies.push_back(d);
}
/**
- * Adds multiple Domain references to this Document.
+ * Adds multiple Ontology references to this Document.
*/
- void referenceDomains(const std::vector<Handle<Domain>> &d)
+ void referenceOntologys(const std::vector<Handle<Ontology>> &d)
{
invalidate();
- domains.insert(domains.end(), d.begin(), d.end());
+ ontologies.insert(ontologies.end(), d.begin(), d.end());
}
/**
diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp
index fe8db16..0567e67 100644
--- a/src/core/model/Node.hpp
+++ b/src/core/model/Node.hpp
@@ -88,7 +88,7 @@ struct ResolutionResult {
/**
* Root node of the subtree in which the node was found. This e.g. points to
- * the Domain in which a Structure was defined or the Typesystem in which a
+ * the Ontology in which a Structure was defined or the Typesystem in which a
* Type was defined. May be nullptr.
*/
Rooted<Node> resolutionRoot;
@@ -119,7 +119,7 @@ class ResolutionState;
/**
* The Node class builds the base class for any Node within the DOM graph. A
- * node may either be a descriptive node (such as a domain description etc.)
+ * node may either be a descriptive node (such as a ontology description etc.)
* or a document element. Each node is identified by acharacteristic name and
* a parent element. Note that the node name is not required to be unique. Nodes
* without parent are considered root nodes.
diff --git a/src/core/model/Domain.cpp b/src/core/model/Ontology.cpp
index 8255401..8829139 100644
--- a/src/core/model/Domain.cpp
+++ b/src/core/model/Ontology.cpp
@@ -23,7 +23,7 @@
#include <core/common/RttiBuilder.hpp>
#include <core/common/Exceptions.hpp>
-#include "Domain.hpp"
+#include "Ontology.hpp"
namespace ousia {
@@ -416,9 +416,9 @@ bool Descriptor::doValidate(Logger &logger) const
std::string("Descriptor \"") + getName() + "\" has no parent!",
*this);
valid = false;
- } else if (!getParent()->isa(&RttiTypes::Domain)) {
+ } else if (!getParent()->isa(&RttiTypes::Ontology)) {
logger.error(std::string("The parent of Descriptor \"") + getName() +
- "\" is not a Domain!",
+ "\" is not a Ontology!",
*this);
valid = false;
}
@@ -672,10 +672,10 @@ std::pair<Rooted<FieldDescriptor>, bool> Descriptor::createFieldDescriptor(
/* Class StructuredClass */
StructuredClass::StructuredClass(Manager &mgr, std::string name,
- Handle<Domain> domain, Variant cardinality,
+ Handle<Ontology> ontology, Variant cardinality,
Handle<StructuredClass> superclass,
bool transparent, bool root)
- : Descriptor(mgr, std::move(name), domain),
+ : Descriptor(mgr, std::move(name), ontology),
cardinality(cardinality),
superclass(acquire(superclass)),
subclasses(this),
@@ -686,8 +686,8 @@ StructuredClass::StructuredClass(Manager &mgr, std::string name,
if (superclass != nullptr) {
superclass->addSubclass(this, logger);
}
- if (domain != nullptr) {
- domain->addStructuredClass(this);
+ if (ontology != nullptr) {
+ ontology->addStructuredClass(this);
}
}
@@ -843,27 +843,27 @@ NodeVector<FieldDescriptor> StructuredClass::getFieldDescriptors() const
/* Class AnnotationClass */
AnnotationClass::AnnotationClass(Manager &mgr, std::string name,
- Handle<Domain> domain)
- : Descriptor(mgr, std::move(name), domain)
+ Handle<Ontology> ontology)
+ : Descriptor(mgr, std::move(name), ontology)
{
- if (domain != nullptr) {
- domain->addAnnotationClass(this);
+ if (ontology != nullptr) {
+ ontology->addAnnotationClass(this);
}
}
-/* Class Domain */
+/* Class Ontology */
-void Domain::doResolve(ResolutionState &state)
+void Ontology::doResolve(ResolutionState &state)
{
continueResolveComposita(structuredClasses, structuredClasses.getIndex(),
state);
continueResolveComposita(annotationClasses, annotationClasses.getIndex(),
state);
continueResolveReferences(typesystems, state);
- continueResolveReferences(domains, state);
+ continueResolveReferences(ontologies, state);
}
-bool Domain::doValidate(Logger &logger) const
+bool Ontology::doValidate(Logger &logger) const
{
// check validity of name, of StructuredClasses, of AnnotationClasses and
// TypeSystems.
@@ -873,22 +873,22 @@ bool Domain::doValidate(Logger &logger) const
continueValidationCheckDuplicates(typesystems, logger);
}
-void Domain::doReference(Handle<Node> node)
+void Ontology::doReference(Handle<Node> node)
{
if (node->isa(&RttiTypes::Typesystem)) {
referenceTypesystem(node.cast<Typesystem>());
}
- if (node->isa(&RttiTypes::Domain)) {
- referenceDomain(node.cast<Domain>());
+ if (node->isa(&RttiTypes::Ontology)) {
+ referenceOntology(node.cast<Ontology>());
}
}
-RttiSet Domain::doGetReferenceTypes() const
+RttiSet Ontology::doGetReferenceTypes() const
{
- return RttiSet{&RttiTypes::Domain, &RttiTypes::Typesystem};
+ return RttiSet{&RttiTypes::Ontology, &RttiTypes::Typesystem};
}
-void Domain::addStructuredClass(Handle<StructuredClass> s)
+void Ontology::addStructuredClass(Handle<StructuredClass> s)
{
// only add it if we need to.
if (structuredClasses.find(s) == structuredClasses.end()) {
@@ -899,13 +899,13 @@ void Domain::addStructuredClass(Handle<StructuredClass> s)
if (par != this) {
if (par != nullptr) {
// remove the StructuredClass from the old parent.
- par.cast<Domain>()->removeStructuredClass(s);
+ par.cast<Ontology>()->removeStructuredClass(s);
}
s->setParent(this);
}
}
-bool Domain::removeStructuredClass(Handle<StructuredClass> s)
+bool Ontology::removeStructuredClass(Handle<StructuredClass> s)
{
auto it = structuredClasses.find(s);
if (it != structuredClasses.end()) {
@@ -917,7 +917,7 @@ bool Domain::removeStructuredClass(Handle<StructuredClass> s)
return false;
}
-Rooted<StructuredClass> Domain::createStructuredClass(
+Rooted<StructuredClass> Ontology::createStructuredClass(
std::string name, Variant cardinality, Handle<StructuredClass> superclass,
bool transparent, bool root)
{
@@ -926,7 +926,7 @@ Rooted<StructuredClass> Domain::createStructuredClass(
std::move(transparent), std::move(root))};
}
-void Domain::addAnnotationClass(Handle<AnnotationClass> a)
+void Ontology::addAnnotationClass(Handle<AnnotationClass> a)
{
// only add it if we need to.
if (annotationClasses.find(a) == annotationClasses.end()) {
@@ -937,13 +937,13 @@ void Domain::addAnnotationClass(Handle<AnnotationClass> a)
if (par != this) {
if (par != nullptr) {
// remove the StructuredClass from the old parent.
- par.cast<Domain>()->removeAnnotationClass(a);
+ par.cast<Ontology>()->removeAnnotationClass(a);
}
a->setParent(this);
}
}
-bool Domain::removeAnnotationClass(Handle<AnnotationClass> a)
+bool Ontology::removeAnnotationClass(Handle<AnnotationClass> a)
{
auto it = annotationClasses.find(a);
if (it != annotationClasses.end()) {
@@ -955,7 +955,7 @@ bool Domain::removeAnnotationClass(Handle<AnnotationClass> a)
return false;
}
-Rooted<AnnotationClass> Domain::createAnnotationClass(std::string name)
+Rooted<AnnotationClass> Ontology::createAnnotationClass(std::string name)
{
return Rooted<AnnotationClass>{
new AnnotationClass(getManager(), std::move(name), this)};
@@ -974,7 +974,7 @@ const Rtti StructuredClass =
.composedOf(&FieldDescriptor);
const Rtti AnnotationClass =
RttiBuilder<ousia::AnnotationClass>("AnnotationClass").parent(&Descriptor);
-const Rtti Domain = RttiBuilder<ousia::Domain>("Domain")
+const Rtti Ontology = RttiBuilder<ousia::Ontology>("Ontology")
.parent(&RootNode)
.composedOf({&StructuredClass, &AnnotationClass});
}
diff --git a/src/core/model/Domain.hpp b/src/core/model/Ontology.hpp
index 7e10d91..948caa5 100644
--- a/src/core/model/Domain.hpp
+++ b/src/core/model/Ontology.hpp
@@ -17,11 +17,11 @@
*/
/**
- * @file Domain.hpp
+ * @file Ontology.hpp
*
- * This header contains the class hierarchy of descriptor classes for domains.
- * Properly connected instances of these classes with a Domain node as root
- * describe a semantic Domain in a formal way. It specifies the allowed (tree)
+ * This header contains the class hierarchy of descriptor classes for ontologies.
+ * Properly connected instances of these classes with a Ontology node as root
+ * describe a semantic Ontology in a formal way. It specifies the allowed (tree)
* structure of a document by means of StructuredClasses as well as the allowed
* Annotations by means of AnnotationClasses.
*
@@ -33,7 +33,7 @@
* book and one for the actual structure. Consider the following XML:
*
* \code{.xml}
- * <domain name="book">
+ * <ontology name="book">
* <struct name="book" cardinality="1" isRoot="true">
* <field>
* <childRef ref="book.chapter"/>
@@ -65,7 +65,7 @@
* <struct name="text" transparent="true">
* <primitive type="string"/>
* </struct>
- * </domain>
+ * </ontology>
* \endcode
*
* Note that we define one field as the TREE (meaning the main or default
@@ -95,12 +95,12 @@
* the proper StructuredClass. This can be regulated by the "cardinality"
* property of a StructuredClass.
*
- * It is possible to add further fields, like we would in the "headings" domain
+ * It is possible to add further fields, like we would in the "headings" ontology
* to add titles to our structure.
*
* \code{.xml}
- * <domain name="headings">
- * <import rel="domain" src="./book_domain.osxml"/>
+ * <ontology name="headings">
+ * <import rel="ontology" src="./book_ontology.osxml"/>
* <struct name="heading" cardinality="1" transparent="true">
* <parentRef ref="book.book">
* <field name="heading" isSubtree="true" optional="true"/>
@@ -108,7 +108,7 @@
* ...
* <fieldRef name="book.paragraph.">
* </struct>
- * </domain>
+ * </ontology>
* \endcode
*
* This would change the context free grammar as follows:
@@ -119,14 +119,14 @@
* \endcode
*
* AnnotationClasses on the other hand do not specify a context free grammar.
- * They merely specify what kinds of Annotations are allowed within this domain
+ * They merely specify what kinds of Annotations are allowed within this ontology
* and which fields or attributes they have. Note that Annotations are allowed
* to define structured children that manifest e.g. meta information of that
- * Annotation. An example for that would be the "comment" domain:
+ * Annotation. An example for that would be the "comment" ontology:
*
* \code{.xml}
- * <domain name="comments">
- * <import rel="domain" src="./book_domain.osxml"/>
+ * <ontology name="comments">
+ * <import rel="ontology" src="./book_ontology.osxml"/>
*
* <annotation name="comment">
* <field name="content" isSubtree="true">
@@ -156,7 +156,7 @@
* <childRef ref="reply"/>
* </field>
* </struct>
- * </domain>
+ * </ontology>
* \endcode
*
* Here we have comment annotations, which have a reply tree as sub structure.
@@ -180,7 +180,7 @@ namespace ousia {
class Rtti;
class Descriptor;
class StructuredClass;
-class Domain;
+class Ontology;
/**
* Magic field name used to identify the default field. The default field is
@@ -481,8 +481,8 @@ protected:
bool doValidate(Logger &logger) const override;
public:
- Descriptor(Manager &mgr, std::string name, Handle<Domain> domain)
- : Node(mgr, std::move(name), domain),
+ Descriptor(Manager &mgr, std::string name, Handle<Ontology> ontology)
+ : Node(mgr, std::move(name), ontology),
attributesDescriptor(acquire(new StructType(mgr, "", nullptr))),
fieldDescriptors(this)
{
@@ -490,10 +490,10 @@ public:
/**
* Returns a reference to the StructType that specifies the attribute keys
- * as well as value domains for this Descriptor.
+ * as well as value ontologies for this Descriptor.
*
* @return a reference to the StructType that specifies the attribute keys
- * as well as value domains for this Descriptor.
+ * as well as value ontologies for this Descriptor.
*/
Rooted<StructType> getAttributesDescriptor() const
{
@@ -645,7 +645,7 @@ public:
/**
* This tries to construct the shortest possible path of this Descriptor
- * to the given child Descriptor. As an example consider the book domain
+ * to the given child Descriptor. As an example consider the book ontology
* from above.
*
* First consider the call book->pathTo(chapter). This is an easy example:
@@ -729,17 +729,17 @@ public:
/**
* A StructuredClass specifies nodes in the StructureTree of a document that
- * implements this domain. For more information on the StructureTree please
+ * implements this ontology. For more information on the StructureTree please
* consult the Header documentation above.
*
- * Note that a StructuredClass may "invade" an existing Domain description by
+ * Note that a StructuredClass may "invade" an existing Ontology description by
* defining itself as a viable child in one existing field. Consider the
- * example of the "heading" domain from the header documentation again:
+ * example of the "heading" ontology from the header documentation again:
*
* \code{.xml}
- * <domain name="headings">
+ * <ontology name="headings">
* <head>
- * <import rel="domain" src="book.oxm"/>
+ * <import rel="ontology" src="book.oxm"/>
* </head>
* <structs>
* <struct name="heading" cardinality="0-1" transparent="true">
@@ -753,14 +753,14 @@ public:
* <fieldRef name="book.paragraph.">
* </fields>
* </structs>
- * </domain>
+ * </ontology>
* \endcode
*
- * The "parent" construct allows to "invade" another domain.
+ * The "parent" construct allows to "invade" another ontology.
*
- * This does indeed interfere with an existing domain and one must carefully
+ * This does indeed interfere with an existing ontology and one must carefully
* craft such parent references to not create undesired side effects. However
- * they provide the most convenient mechanism to extend existing domains
+ * they provide the most convenient mechanism to extend existing ontologies
* without having to rewrite them.
*
* Another important factor is the 'transparent' flag. Transparent
@@ -798,7 +798,7 @@ public:
* Inheritance therefore also goes for fields.
*/
class StructuredClass : public Descriptor {
- friend Domain;
+ friend Ontology;
private:
const Variant cardinality;
@@ -824,7 +824,7 @@ public:
*
* @param mgr is the current Manager.
* @param name is the name of the StructuredClass.
- * @param domain is the Domain this StructuredClass belongs
+ * @param ontology is the Ontology this StructuredClass belongs
* to.
* @param cardinality specifies how often an element of this type
* may occur at a specific point in the
@@ -846,7 +846,7 @@ public:
* allowed to be at the root of a Document.
*/
StructuredClass(Manager &mgr, std::string name,
- Handle<Domain> domain = nullptr,
+ Handle<Ontology> ontology = nullptr,
Variant cardinality = Cardinality::any(),
Handle<StructuredClass> superclass = nullptr,
bool transparent = false, bool root = false);
@@ -972,7 +972,7 @@ public:
* This class has no special properties and is in essence just a Descriptor.
*/
class AnnotationClass : public Descriptor {
- friend Domain;
+ friend Ontology;
public:
/**
@@ -983,18 +983,18 @@ public:
* @param name is a name for this AnnotationClass that will
* be used for later references to this
* AnnotationClass.
- * @param domain is the Domain this AnnotationClass belongs
+ * @param ontology is the Ontology this AnnotationClass belongs
* to.
*/
- AnnotationClass(Manager &mgr, std::string name, Handle<Domain> domain);
+ AnnotationClass(Manager &mgr, std::string name, Handle<Ontology> ontology);
};
/**
- * A Domain node specifies which StructuredClasses and which AnnotationClasses
- * are part of this domain. TODO: Do we want to be able to restrict Annotations
+ * A Ontology node specifies which StructuredClasses and which AnnotationClasses
+ * are part of this ontology. TODO: Do we want to be able to restrict Annotations
* to certain Structures?
*/
-class Domain : public RootNode {
+class Ontology : public RootNode {
friend StructuredClass;
friend AnnotationClass;
@@ -1002,7 +1002,7 @@ private:
NodeVector<StructuredClass> structuredClasses;
NodeVector<AnnotationClass> annotationClasses;
NodeVector<Typesystem> typesystems;
- NodeVector<Domain> domains;
+ NodeVector<Ontology> ontologies;
protected:
void doResolve(ResolutionState &state) override;
@@ -1012,81 +1012,81 @@ protected:
public:
/**
- * The constructor for a new domain. Note that this is an empty Domain and
+ * The constructor for a new ontology. Note that this is an empty Ontology and
* still has to be filled with StructuredClasses and AnnotationClasses.
*
* @param mgr is the Manager instance.
- * @param name is a name for this domain which will be used for later
- * references to this Domain.
+ * @param name is a name for this ontology which will be used for later
+ * references to this Ontology.
*/
- Domain(Manager &mgr, std::string name = "")
+ Ontology(Manager &mgr, std::string name = "")
: RootNode(mgr, std::move(name), nullptr),
structuredClasses(this),
annotationClasses(this),
typesystems(this),
- domains(this)
+ ontologies(this)
{
}
/**
- * The constructor for a new domain. Note that this is an empty Domain and
+ * The constructor for a new ontology. Note that this is an empty Ontology and
* still has to be filled with StructuredClasses and AnnotationClasses.
*
* @param mgr is the Manager instance.
* @param sys is the SystemTypesystem instance.
- * @param name is a name for this domain which will be used for later
- * references to this Domain.
+ * @param name is a name for this ontology which will be used for later
+ * references to this Ontology.
*/
- Domain(Manager &mgr, Handle<SystemTypesystem> sys, std::string name = "")
- : Domain(mgr, std::move(name))
+ Ontology(Manager &mgr, Handle<SystemTypesystem> sys, std::string name = "")
+ : Ontology(mgr, std::move(name))
{
referenceTypesystem(sys);
}
/**
- * Creates a new Domain and returns it.
+ * Creates a new Ontology and returns it.
*
* @param mgr is the Manager instance.
- * @param name is a name for this domain which will be used for later
- * references to this Domain.
+ * @param name is a name for this ontology which will be used for later
+ * references to this Ontology.
*/
- static Rooted<Domain> createEmptyDomain(Manager &mgr, std::string name)
+ static Rooted<Ontology> createEmptyOntology(Manager &mgr, std::string name)
{
- return Rooted<Domain>{new Domain(mgr, std::move(name))};
+ return Rooted<Ontology>{new Ontology(mgr, std::move(name))};
}
/**
* Returns a const reference to the NodeVector of StructuredClasses that are
- * part of this Domain.
+ * part of this Ontology.
*
* @return a const reference to the NodeVector of StructuredClasses that are
- * part of this Domain.
+ * part of this Ontology.
*/
const NodeVector<StructuredClass> &getStructureClasses() const
{
return structuredClasses;
}
/**
- * Adds a StructuredClass to this domain. This also sets the parent of the
- * given StructuredClass if it is not set to this Domain already and removes
- * it from the old Domain.
+ * Adds a StructuredClass to this ontology. This also sets the parent of the
+ * given StructuredClass if it is not set to this Ontology already and removes
+ * it from the old Ontology.
*
* @param s is some StructuredClass.
*/
void addStructuredClass(Handle<StructuredClass> s);
/**
- * Removes a StructuredClass from this domain. This also sets the parent of
+ * Removes a StructuredClass from this ontology. This also sets the parent of
* the given StructuredClass to null.
*
* @param s is some StructuredClass.
* @return true if the given StructuredClass was removed and false if this
- * Domain did not have the given StructuredClass as child.
+ * Ontology did not have the given StructuredClass as child.
*/
bool removeStructuredClass(Handle<StructuredClass> s);
/**
- * This creates a new StructuredClass and appends it to this Domain.
+ * This creates a new StructuredClass and appends it to this Ontology.
*
* @param name is the name of the StructuredClass.
* @param cardinality specifies how often an element of this type
@@ -1117,36 +1117,36 @@ public:
/**
* Returns a const reference to the NodeVector of AnnotationClasses that are
- * part of this Domain.
+ * part of this Ontology.
*
* @return a const reference to the NodeVector of AnnotationClasses that are
- * part of this Domain.
+ * part of this Ontology.
*/
const NodeVector<AnnotationClass> &getAnnotationClasses() const
{
return annotationClasses;
}
/**
- * Adds an AnnotationClass to this domain. This also sets the parent of the
- * given AnnotationClass if it is not set to this Domain already and removes
- * it from the old Domain.
+ * Adds an AnnotationClass to this ontology. This also sets the parent of the
+ * given AnnotationClass if it is not set to this Ontology already and removes
+ * it from the old Ontology.
*
* @param a is some AnnotationClass.
*/
void addAnnotationClass(Handle<AnnotationClass> a);
/**
- * Removes a AnnotationClass from this domain. This also sets the parent of
+ * Removes a AnnotationClass from this ontology. This also sets the parent of
* the given AnnotationClass to null.
*
* @param a is some AnnotationClass.
* @return true if the given AnnotationClass was removed and false if this
- * Domain did not have the given AnnotationClass as child.
+ * Ontology did not have the given AnnotationClass as child.
*/
bool removeAnnotationClass(Handle<AnnotationClass> a);
/**
- * This creates a new AnnotationClass and appends it to this Domain.
+ * This creates a new AnnotationClass and appends it to this Ontology.
*
* @param name is a name for this AnnotationClass that will
* be used for later references to this
@@ -1156,20 +1156,20 @@ public:
/**
* Returns a const reference to the NodeVector of TypeSystems that are
- * references in this Domain.
+ * references in this Ontology.
*
* @return a const reference to the NodeVector of TypeSystems that are
- * references in this Domain.
+ * references in this Ontology.
*/
const NodeVector<Typesystem> &getTypesystems() const { return typesystems; }
/**
- * Adds a Typesystem reference to this Domain.
+ * Adds a Typesystem reference to this Ontology.
*/
void referenceTypesystem(Handle<Typesystem> t) { typesystems.push_back(t); }
/**
- * Adds multiple Typesystem references to this Domain.
+ * Adds multiple Typesystem references to this Ontology.
*/
void referenceTypesystems(const std::vector<Handle<Typesystem>> &ts)
{
@@ -1177,16 +1177,16 @@ public:
}
/**
- * Adds a Domain reference to this Domain.
+ * Adds a Ontology reference to this Ontology.
*/
- void referenceDomain(Handle<Domain> d) { domains.push_back(d); }
+ void referenceOntology(Handle<Ontology> d) { ontologies.push_back(d); }
/**
- * Adds multiple Domain references to this Domain.
+ * Adds multiple Ontology references to this Ontology.
*/
- void referenceDomains(const std::vector<Handle<Domain>> &ds)
+ void referenceOntologys(const std::vector<Handle<Ontology>> &ds)
{
- domains.insert(domains.end(), ds.begin(), ds.end());
+ ontologies.insert(ontologies.end(), ds.begin(), ds.end());
}
};
@@ -1196,7 +1196,7 @@ extern const Rtti FieldDescriptor;
extern const Rtti Descriptor;
extern const Rtti StructuredClass;
extern const Rtti AnnotationClass;
-extern const Rtti Domain;
+extern const Rtti Ontology;
}
}
diff --git a/src/core/model/Project.cpp b/src/core/model/Project.cpp
index f7dab8a..ecc0589 100644
--- a/src/core/model/Project.cpp
+++ b/src/core/model/Project.cpp
@@ -18,7 +18,7 @@
#include <core/common/RttiBuilder.hpp>
-#include "Domain.hpp"
+#include "Ontology.hpp"
#include "Document.hpp"
#include "Project.hpp"
#include "Typesystem.hpp"
@@ -69,9 +69,9 @@ Rooted<Document> Project::createDocument(const std::string &name)
return document;
}
-Rooted<Domain> Project::createDomain(const std::string &name)
+Rooted<Ontology> Project::createOntology(const std::string &name)
{
- return Rooted<Domain>{new Domain(getManager(), systemTypesystem, name)};
+ return Rooted<Ontology>{new Ontology(getManager(), systemTypesystem, name)};
}
void Project::referenceDocument(Handle<Document> document)
diff --git a/src/core/model/Project.hpp b/src/core/model/Project.hpp
index 480609c..97c711c 100644
--- a/src/core/model/Project.hpp
+++ b/src/core/model/Project.hpp
@@ -20,7 +20,7 @@
* @file Project.hpp
*
* Contains the concept of the "Project" class which represents the entity into
- * which domains, documents, typesystems and other resources are embedded.
+ * which ontologies, documents, typesystems and other resources are embedded.
*
* @author Andreas Stöckel (astoecke@techfak.uni-bielefeld.de)
*/
@@ -40,12 +40,12 @@ class Registry;
class SystemTypesystem;
class Typesystem;
class Document;
-class Domain;
+class Ontology;
/**
* The Project class constitutes the top-level node in which a collection of
* documents are stored. It also contains an instance of the SystemTypesystem
- * and allows for simple creation of new Typesystem and Domain instances.
+ * and allows for simple creation of new Typesystem and Ontology instances.
*/
class Project : public RootNode {
private:
@@ -99,12 +99,12 @@ public:
Rooted<Document> createDocument(const std::string &name);
/**
- * Returns a new domain with the given name and adds it to the list of
- * domains. Provides a reference of the system typesystem to the domain.
+ * Returns a new ontology with the given name and adds it to the list of
+ * ontologies. Provides a reference of the system typesystem to the ontology.
*
- * @param name is the name of the domain that should be created.
+ * @param name is the name of the ontology that should be created.
*/
- Rooted<Domain> createDomain(const std::string &name);
+ Rooted<Ontology> createOntology(const std::string &name);
/**
* Adds the given document to the list of documents in the project.
diff --git a/src/core/model/RootNode.hpp b/src/core/model/RootNode.hpp
index 173a6e4..d26917f 100644
--- a/src/core/model/RootNode.hpp
+++ b/src/core/model/RootNode.hpp
@@ -37,7 +37,7 @@ namespace ousia {
/**
* The RootNode class represents a Node that may be a Root node (such as
- * Documents, Typesystems and Domains). Root nodes have the property, that the
+ * Documents, Typesystems and Ontologys). Root nodes have the property, that the
* allow importing/referencing other Nodes.
*/
class RootNode : public Node {