|
From: <lh...@us...> - 2009-08-14 11:43:37
|
Revision: 347
http://tinytim.svn.sourceforge.net/tinytim/?rev=347&view=rev
Author: lheuer
Date: 2009-08-14 11:43:24 +0000 (Fri, 14 Aug 2009)
Log Message:
-----------
- Added package visible getter to tinytim/mio/TinyTimMapInputHandler to retrieve the topic map
- Added tmdm:subject
- Added docs to TMCL and deprecated some constants
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java
tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java
tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java
Modified: tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-08-13 12:40:55 UTC (rev 346)
+++ tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-08-14 11:43:24 UTC (rev 347)
@@ -100,6 +100,15 @@
_delayedItemIdentifiers = CollectionFactory.createIdentityMap(_DELAYED_ITEM_IDENTIFIER_SIZE);
}
+ /**
+ * Returns the underlying topic map.
+ *
+ * @return The topic map this handler operates upon.
+ */
+ TopicMap getTopicMap() {
+ return _tm;
+ }
+
/* (non-Javadoc)
* @see com.semagia.mio.IMapHandler#startTopicMap()
*/
Modified: tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-08-13 12:40:55 UTC (rev 346)
+++ tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-08-14 11:43:24 UTC (rev 347)
@@ -20,7 +20,7 @@
/**
* Constants for TMCL PSIs.
* <p>
- * These PSIs are not stable yet.
+ * CAUTION: These PSIs are not stable yet.
* </p>
*
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
@@ -35,107 +35,417 @@
private static final String _BASE = Namespace.TMCL;
- // Topic types
+ /**
+ * Core concept of a constraint.
+ *
+ * Used as constraint (topic) type.
+ */
+ public static final Locator CONSTRAINT = _createLocator(_BASE + "constraint");
+
+ /*
+ * Topic types
+ *
+ * c.f. 6. TMCL Declarations
+ */
+ /**
+ * Indicates that a topic may be used as a topic type.
+ *
+ * Used as topic type.
+ */
public static final Locator TOPIC_TYPE = _createLocator(_BASE + "topic-type");
+ /**
+ * Indicates that a topic may be used as association type.
+ *
+ * Used as topic type.
+ */
public static final Locator ASSOCIATION_TYPE = _createLocator(_BASE + "association-type");
+ /**
+ * Indicates that a topic may be used as role type.
+ *
+ * Used as topic type.
+ */
public static final Locator ROLE_TYPE = _createLocator(_BASE + "role-type");
+ /**
+ * Indicates that a topic may be used as occurrence type.
+ *
+ * Used as topic type.
+ */
public static final Locator OCCURRENCE_TYPE = _createLocator(_BASE + "occurrence-type");
+ /**
+ * Indicates that a topic may be used as name type.
+ *
+ * Used as topic type.
+ */
public static final Locator NAME_TYPE = _createLocator(_BASE + "name-type");
+ /**
+ * The tmcl:overlap-declaration is used to declare that the sets of
+ * instances of two or more topic types are non-disjoint (that is, that
+ * they may overlap).
+ * The default is that the instance sets of different topic types are
+ * disjoint.
+ *
+ * Used as topic type.
+ */
+ public static final Locator OVERLAP_DECLARATION = _createLocator(_BASE + "overlap-declaration");
+
+ @Deprecated
+ //FIXME: What's the replacement for this PSI?
public static final Locator SCOPE_TYPE = _createLocator(_BASE + "scope-type");
+
+ /*
+ * Constraint types
+ * c.f. 7 TMCL Constraint Types
+ */
+
+ /**
+ * The tmcl:abstract-constraint provides a way to express that a given topic
+ * type must not have any direct instances
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.2 Abstract Topic Type Constraint
+ */
+ public static final Locator ABSTRACT_CONSTRAINT = _createLocator(_BASE + "abstract-constraint");
+
+ /**
+ * Use {@link #ABSTRACT_CONSTRAINT}
+ */
+ @Deprecated
+ public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = ABSTRACT_CONSTRAINT;
+
+ /**
+ *
+ *
+ * Used as association type.
+ *
+ * See 7.2 Abstract Topic Type Constraint
+ */
+ public static final Locator CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "constrained-topic-type");
+
+ /**
+ * A subject identifier constraint provides a way to constrain the subject
+ * identifiers of instances of a given topic type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.3 Subject Identifier Constraint
+ */
+ public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subject-identifier-constraint");
+
+ /**
+ * A subject locator constraint provides a way to constrain the subject
+ * locators of instances of a given topic type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.4 Subject Locator Constraint
+ */
+ public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subject-locator-constraint");
+
+
+ /**
+ * A topic name constraint provides a way to constrain the type and
+ * cardinality of topic names for instances of a given topic type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.5 Topic Name Constraint
+ */
+ public static final Locator TOPIC_NAME_CONSTRAINT = _createLocator(_BASE + "topic-name-constraint");
+
+ /**
+ * A topic occurrence constraint defines a way to constrain the type and
+ * cardinality of occurrences connected to a topic of a given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.6 Topic Occurrence Constraint
+ */
+ public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topic-occurrence-constraint");
+
+ /**
+ * A topic role constraint constrains the types of roles topics of a given
+ * type can play in associations of a given type.
+ * It can also be seen as constraining the types of topics which may play
+ * roles of a given type in associations of a given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.7 Topic Role Constraint
+ */
+ public static final Locator TOPIC_ROLE_CONSTRAINT = _createLocator(_BASE + "topic-role-constraint");
+
+ /**
+ * Use {@link #TOPIC_ROLE_CONSTRAINT}.
+ */
+ @Deprecated
+ public static final Locator ROLE_PLAYER_CONSTRAINT = TOPIC_ROLE_CONSTRAINT;
+
+ /**
+ * Constrains the types of topics which may appear in the scope of a name,
+ * occurrence, or association of a particular type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.8 Scope Constraint.
+ */
+ public static final Locator SCOPE_CONSTRAINT = _createLocator(_BASE + "scope-constraint");
+
+ /**
+ * Constrains whether or not names, occurrence, and associations of a given
+ * type may be reified, and if so, what the type of the reifying topic must
+ * be.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.9 Reifier Constraint
+ */
+ public static final Locator REIFIER_CONSTRAINT = _createLocator(_BASE + "reifier-constraint");
+
+ /**
+ * Constrains what types of statements topics of a given type may reify.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.10 Topic Reifies Constraint
+ */
+ public static final Locator TOPIC_REIFIES_CONSTRAINT = _createLocator(_BASE + "topic-reifies-constraint");
+
+ /**
+ * Constrains the number of roles of a particular type that may appear in
+ * associations of a given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.11 Association Role Constraint
+ */
+ public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "association-role-constraint");
+
+ /**
+ * Provides a way to restrict which combinations of topic types are allowed
+ * to appear in associations of a certain type together.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.12 Role Combination Constraint
+ */
+ public static final Locator ROLE_COMBINATION_CONSTRAINT = _createLocator(_BASE + "role-combination-constraint");
+
+ /**
+ * Provides a way to constrain the allowed datatype of an occurrence of a
+ * given type.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.13 Occurrence Data Type Constraint.
+ */
+ public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrence-datatype-constraint");
+
+ /**
+ * Provides a way to require all names or occurrences of a given type to
+ * have different values.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.14 Unique Value Constraint
+ */
+ public static final Locator UNIQUE_VALUE_CONSTRAINT = _createLocator(_BASE + "unique-value-constraint");
+
+ /**
+ * Provides a mechanism for requiring that all values of a given name or
+ * occurrence type must match a given regular expression.
+ *
+ * Used as constraint (topic) type.
+ *
+ * See 7.15 Regular Expression Constraint
+ */
+ public static final Locator REGULAR_EXPRESSION_CONSTRAINT = _createLocator(_BASE + "regular-expression-constraint");
+
+
// Role types
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator ALLOWS = _createLocator(_BASE + "allows");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator ALLOWED = _createLocator(_BASE + "allowed");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONSTRAINS = _createLocator(_BASE + "constrains");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONSTRAINED = _createLocator(_BASE + "constrained");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONTAINER = _createLocator(_BASE + "container");
+ /**
+ *
+ * Used as role type.
+ */
public static final Locator CONTAINEE = _createLocator(_BASE + "containee");
- // Association types - applies-to is no more
- public static final Locator CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "constrained-topic-type");
-
+ /*
+ * Association types
+ */
+
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator CONSTRAINED_STATEMENT = _createLocator(_BASE + "constrained-statement");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator CONSTRAINED_ROLE = _createLocator(_BASE + "constrained-role");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator OVERLAPS = _createLocator(_BASE + "overlaps");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator ALLOWED_SCOPE = _createLocator(_BASE + "allowed-scope");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator ALLOWED_REIFIER = _createLocator(_BASE + "allowed-reifier");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator OTHER_CONSTRAINED_TOPIC_TYPE = _createLocator(_BASE + "other-constrained-topic-type");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator OTHER_CONSTRAINED_ROLE = _createLocator(_BASE + "other-constrained-role");
+ /**
+ *
+ * Used as association type.
+ */
public static final Locator BELONGS_TO_SCHEMA = _createLocator(_BASE + "belongs-to-schema");
// Model topics
- public static final Locator SCHEMA = _createLocator(_BASE + "schema");
-
- public static final Locator CONSTRAINT = _createLocator(_BASE + "constraint");
-
public static final Locator VALIDATION_EXPRESSION = _createLocator(_BASE + "validation-expression");
+ /**
+ * Indicates a minimum cardinality.
+ *
+ * Used as occurrence type.
+ */
public static final Locator CARD_MIN = _createLocator(_BASE + "card-min");
+ /**
+ * Indicates a maximum cardinality.
+ *
+ * Used as occurrence type.
+ */
public static final Locator CARD_MAX = _createLocator(_BASE + "card-max");
+ /**
+ * Used to define a regular expression.
+ *
+ * Used as occurrence type.
+ */
public static final Locator REGEXP = _createLocator(_BASE + "regexp");
+ /**
+ * Used to define the datatype (an IRI) of an occurrence or variant.
+ *
+ * Used as occurrence type.
+ */
public static final Locator DATATYPE = _createLocator(_BASE + "datatype");
-
- public static final Locator VERSION = _createLocator(_BASE + "version");
- public static final Locator DESCRIPTION = _createLocator(_BASE + "description");
+ /*
+ * 10 Schema Documentation.
+ */
- public static final Locator COMMENT = _createLocator(_BASE + "comment");
+ /**
+ *
+ * Used as topic type.
+ *
+ * See 10.2 The Schema Topic
+ */
+ public static final Locator SCHEMA = _createLocator(_BASE + "schema");
- public static final Locator SEE_ALSO = _createLocator(_BASE + "see-also");
-
- // Constraint types
+ /**
+ * Used to attach some identifier of the schema's version to the schema
+ * topic.
+ *
+ * Used as occurrence type.
+ * See 10.2 The Schema Topic
+ */
+ public static final Locator VERSION = _createLocator(_BASE + "version");
- public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "abstract-constraint");
- public static final Locator OVERLAP_DECLARATION = _createLocator(_BASE + "overlap-declaration");
+ /*
+ * 10.3 Documentation Occurrences
+ */
- public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subject-identifier-constraint");
-
- public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subject-locator-constraint");
+ /**
+ * Used to attach a textual description of a TMCL construct to it inside
+ * the topic map.
+ *
+ * Used as occurrence type.
+ *
+ * See 10.3 Documentation Occurrences
+ */
+ public static final Locator DESCRIPTION = _createLocator(_BASE + "description");
- public static final Locator TOPIC_NAME_CONSTRAINT = _createLocator(_BASE + "topic-name-constraint");
+ /**
+ * Used to attach any textual information to a TMCL construct inside the
+ * topic map.
+ *
+ * Used as occurrence type.
+ *
+ * See 10.3 Documentation Occurrences
+ */
+ public static final Locator COMMENT = _createLocator(_BASE + "comment");
- public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topic-occurrence-constraint");
-
- public static final Locator ROLE_PLAYER_CONSTRAINT = _createLocator(_BASE + "role-player-constraint");
-
- public static final Locator SCOPE_CONSTRAINT = _createLocator(_BASE + "scope-constraint");
-
- public static final Locator REIFIER_CONSTRAINT = _createLocator(_BASE + "reifier-constraint");
+ /**
+ * Used to attach a to a TMCL construct a reference to any kind of external
+ * information about that construct.
+ *
+ * Used as occurrence type.
+ *
+ * See 10.3 Documentation Occurrences
+ */
+ public static final Locator SEE_ALSO = _createLocator(_BASE + "see-also");
- public static final Locator TOPIC_REIFIES_CONSTRAINT = _createLocator(_BASE + "topic-reifies-constraint");
-
- public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "association-role-constraint");
-
- public static final Locator ROLE_COMBINATION_CONSTRAINT = _createLocator(_BASE + "role-combination-constraint");
-
- public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrence-datatype-constraint");
-
- public static final Locator UNIQUE_VALUE_CONSTRAINT = _createLocator(_BASE + "unique-value-constraint");
-
- public static final Locator REGULAR_EXPRESSION_CONSTRAINT = _createLocator(_BASE + "regular-expression-constraint");
}
Modified: tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java 2009-08-13 12:40:55 UTC (rev 346)
+++ tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java 2009-08-14 11:43:24 UTC (rev 347)
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Lars Heuer (heuer[at]semagia.com)
+ * Copyright 2008 - 2009 Lars Heuer (heuer[at]semagia.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,6 @@
/**
* Constants for TMDM 1.0 (model) PSIs.
*
- * Copied with permission from the Semagia MIO project.
- *
* @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
* @version $Rev$ - $Date$
*/
@@ -34,6 +32,11 @@
private static final String _BASE = Namespace.TMDM_MODEL;
/**
+ * Core concept of a subject.
+ */
+ public static final Locator SUBJECT = _createLocator(_BASE + "subject");
+
+ /**
* Core concept of type-instance relationships.
* Used as association type.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|