You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
(48) |
May
(21) |
Jun
(3) |
Jul
(10) |
Aug
(66) |
Sep
(11) |
Oct
(7) |
Nov
(73) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(3) |
Feb
(17) |
Mar
(19) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(43) |
Aug
(18) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
|
2010 |
Jan
(3) |
Feb
(7) |
Mar
(21) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(6) |
Aug
(6) |
Sep
(7) |
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <lh...@us...> - 2009-04-03 11:35:42
|
Revision: 294 http://tinytim.svn.sourceforge.net/tinytim/?rev=294&view=rev Author: lheuer Date: 2009-04-03 11:35:36 +0000 (Fri, 03 Apr 2009) Log Message: ----------- Initial import of the schema interfaces Added Paths: ----------- tinytim-schema/ tinytim-schema/branches/ tinytim-schema/tags/ tinytim-schema/trunk/ tinytim-schema/trunk/src/ tinytim-schema/trunk/src/main/ tinytim-schema/trunk/src/main/java/ tinytim-schema/trunk/src/main/java/org/ tinytim-schema/trunk/src/main/java/org/tinytim/ tinytim-schema/trunk/src/main/java/org/tinytim/schema/ tinytim-schema/trunk/src/main/java/org/tinytim/schema/Schema.java tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaErrorHandler.java tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaException.java tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaReader.java tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaValidator.java tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaViolationException.java Added: tinytim-schema/trunk/src/main/java/org/tinytim/schema/Schema.java =================================================================== --- tinytim-schema/trunk/src/main/java/org/tinytim/schema/Schema.java (rev 0) +++ tinytim-schema/trunk/src/main/java/org/tinytim/schema/Schema.java 2009-04-03 11:35:36 UTC (rev 294) @@ -0,0 +1,38 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.schema; + +/** + * Representation of an immutable Topic Maps schema. + * <p> + * A schema represents a set of constraints that can be checked against a + * topic map. + * </p> + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public interface Schema { + + /** + * Returns a schema validator that is able to validate a topic map against + * this schema. + * + * @return A schema validator. + */ + public SchemaValidator createValidator(); + +} Property changes on: tinytim-schema/trunk/src/main/java/org/tinytim/schema/Schema.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaErrorHandler.java =================================================================== --- tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaErrorHandler.java (rev 0) +++ tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaErrorHandler.java 2009-04-03 11:35:36 UTC (rev 294) @@ -0,0 +1,56 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.schema; + +import org.tmapi.core.Construct; + +/** + * Handler which gets notified in case of Topic Maps schema violations. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public interface SchemaErrorHandler { + + /** + * Notification when the validation starts. + * + * @throws SchemaViolationException In case of an error. + */ + public void startValidation() throws SchemaViolationException; + + /** + * Notification when the validation has finished. + * + * @throws SchemaViolationException In case of an error. + */ + public void endValidation() throws SchemaViolationException; + + /** + * Notification when an error has occured. + * <p> + * The handler may throw a {@link SchemaViolationException} or simply report + * the violation (i.e. write a log entry) without forcing the + * {@link SchemaValidator} to stop the validation process. + * </p> + * + * @param message The error message. + * @param construct The construct which causes the error. + * @throws SchemaViolationException Default case. + */ + public void error(String message, Construct construct) throws SchemaViolationException; + +} Property changes on: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaErrorHandler.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaException.java =================================================================== --- tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaException.java (rev 0) +++ tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaException.java 2009-04-03 11:35:36 UTC (rev 294) @@ -0,0 +1,45 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.schema; + +/** + * Generic schema-specific exception which may be thrown in case of + * schema-related errors (i.e. syntax errors). + * <p> + * This exception must not be thrown in case of schema violation errors, use + * {@link SchemaViolationException} for that purpose. + * </p> + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class SchemaException extends Exception { + + /** + * + */ + private static final long serialVersionUID = -2670201943956954869L; + + /** + * Initializes a new instance. + * + * @param message The message. + */ + public SchemaException(String message) { + super(message); + } + +} Property changes on: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaException.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaReader.java =================================================================== --- tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaReader.java (rev 0) +++ tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaReader.java 2009-04-03 11:35:36 UTC (rev 294) @@ -0,0 +1,42 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.schema; + +import java.io.IOException; + +/** + * This interface represents a reader to deserialize a Topic Maps schema from + * a source. + * <p> + * The reader is not meant to be reused and should be thrown away once the + * {@link #read()} method was invoked. + * </p> + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public interface SchemaReader { + + /** + * Reads a schema. + * + * @return The read schema. + * @throws IOException If an error occurs. + * @throws SchemaException If a schema-specific error occurs (i.e. syntax error). + */ + public Schema read() throws IOException, SchemaException; + +} Property changes on: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaReader.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaValidator.java =================================================================== --- tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaValidator.java (rev 0) +++ tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaValidator.java 2009-04-03 11:35:36 UTC (rev 294) @@ -0,0 +1,65 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.schema; + +import org.tmapi.core.TopicMap; + +/** + * Validates a topic map with respect to a schema. The schema is determined when + * the <tt>SchemaValidator</tt> is created and cannot be changed. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public interface SchemaValidator { + + /** + * Returns the underlying error handler. + * <p> + * If no error handler was set explictly via + * {@link #setErrorHandler(SchemaErrorHandler)}, the schema validator + * returns a default error handler. + * </p> + * + * @return The error handler instance, never <tt>null</tt>. + */ + public SchemaErrorHandler getErrorHandler(); + + /** + * Sets the error handler which is used to report errors. + * <p> + * A previously set error handler will be overridden. + * </p> + * + * @param errorHandler The error handler. + */ + public void setErrorHandler(SchemaErrorHandler errorHandler); + + /** + * Validates the topic map against the schema to which this validator + * instance is bound to. + * <p> + * If the schema validator stops at the first error or checks the whole + * topic map and reports all found errors depends on the + * {@link SchemaErrorHandler}. + * </p> + * + * @param topicMap The topic map to validate. + * @throws SchemaViolationException In case of an error. + */ + public void validate(TopicMap topicMap) throws SchemaViolationException; + +} Property changes on: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaValidator.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaViolationException.java =================================================================== --- tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaViolationException.java (rev 0) +++ tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaViolationException.java 2009-04-03 11:35:36 UTC (rev 294) @@ -0,0 +1,60 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.schema; + +import org.tmapi.core.Construct; + +/** + * Exception thrown in case of a schema violation. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class SchemaViolationException extends SchemaException { + + /** + * + */ + private static final long serialVersionUID = -9188289535093661832L; + + /** + * The construct which violates the schema. + */ + private final Construct _construct; + + /** + * Initializes a new instance. + * + * @param message The message. + * @param construct The construct which violates the schema, must not be <tt>null</tt>. + */ + public SchemaViolationException(String message, Construct construct) { + super(message); + if (construct == null) { + throw new IllegalArgumentException("The construct must not be null"); + } + _construct = construct; + } + + /** + * Returns the construct which has violates the {@link Schema}. + * + * @return The construct which violates the schema. + */ + public Construct getConstruct() { + return _construct; + } +} Property changes on: tinytim-schema/trunk/src/main/java/org/tinytim/schema/SchemaViolationException.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-26 09:24:59
|
Revision: 293 http://tinytim.svn.sourceforge.net/tinytim/?rev=293&view=rev Author: lheuer Date: 2009-03-26 09:24:44 +0000 (Thu, 26 Mar 2009) Log Message: ----------- Added utility class to fetch the super-/subtypes of a topic and to check if a topic is an instance of another topic (supertypes / subtypes are taken into account) Added Paths: ----------- tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceUtils.java tinytim/trunk/src/test/java/org/tinytim/utils/TestTypeInstanceUtils.java Added: tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceUtils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceUtils.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceUtils.java 2009-03-26 09:24:44 UTC (rev 293) @@ -0,0 +1,224 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.utils; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import org.tinytim.internal.api.IAssociation; +import org.tinytim.voc.TMDM; +import org.tmapi.core.Locator; +import org.tmapi.core.Role; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; +import org.tmapi.core.Typed; + +/** + * Utility functions to retrieve the supertypes / subtypes of a topic and + * to check if a topic is an instance of another topic. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class TypeInstanceUtils { + + private static final RolePlayerWalker _SUPERTYPES_WALKER = new RolePlayerWalker(TMDM.SUPERTYPE_SUBTYPE, TMDM.SUBTYPE, TMDM.SUPERTYPE); + private static final RolePlayerWalker _SUBTYPES_WALKER = new RolePlayerWalker(TMDM.SUPERTYPE_SUBTYPE, TMDM.SUPERTYPE, TMDM.SUBTYPE); + + private TypeInstanceUtils() { + // noop + } + + /** + * Returns if <tt>instance</tt> is an instance of <tt>type</tt>. + * <p> + * The typed construct is an instance of <tt>type</tt> if {@link Typed#getType()} + * is equal to the provided <tt>type</tt> or if <tt>type</tt> is a supertype + * of {@link Typed#getType()}. + * </p> + * + * @param instance The instance. + * @param type The type. + * @return <tt>true</tt> if the typed construct is an instance of <tt>type</tt>, + * otherwise <tt>false</tt>. + */ + public static boolean isInstanceOf(Typed instance, Topic type) { + if (instance == null) { + throw new IllegalArgumentException("The instance must not be null"); + } + if (type == null) { + throw new IllegalArgumentException("The type must not be null"); + } + return instance.getType().equals(type) + || _SUPERTYPES_WALKER.isAssociated(instance.getType(), type); + } + + /** + * Returns if <tt>instance</tt> is an instance of <tt>type</tt>. + * <p> + * The topic is an instance of <tt>type</tt> if {@link Topic#getTypes()} + * contains <tt>type</tt> or if one of the topics returned by {@link Topic#getTypes()} + * is a subtype of <tt>type</tt>. + * </p> + * + * @param instance The instance. + * @param type The type. + * @return <tt>true</tt> if the topic is an instance of <tt>type</tt>, + * otherwise <tt>false</tt>. + */ + public static boolean isInstanceOf(Topic instance, Topic type) { + if (instance == null) { + throw new IllegalArgumentException("The instance must not be null"); + } + if (type == null) { + throw new IllegalArgumentException("The type must not be null"); + } + Collection<Topic> types = instance.getTypes(); + if (types.contains(type)) { + return true; + } + for (Topic topicType: types) { + if (_SUPERTYPES_WALKER.isAssociated(topicType, type)) { + return true; + } + } + return false; + } + + /** + * Returns the supertypes of <tt>subtype</tt>. + * <p> + * If <tt>subtype</tt> does not participate in a supertype-subtype association, + * the returned collection is empty. + * </p> + * + * @param subtype The subtype. + * @return A (maybe empty) collection of supertypes. + */ + public static Collection<Topic> getSupertypes(Topic subtype) { + if (subtype == null) { + throw new IllegalArgumentException("The subtype must not be null"); + } + return _SUPERTYPES_WALKER.walk(subtype); + } + + /** + * Returns the subtypes of <tt>supertype</tt>. + * <p> + * If <tt>supertype</tt> does not participate in a supertype-subtype association, + * the returned collection is empty. + * </p> + * + * @param supertype The supertype. + * @return A (maybe empty) collection of subtypes. + */ + public static Collection<Topic> getSubtypes(Topic supertype) { + if (supertype == null) { + throw new IllegalArgumentException("The supertype must not be null"); + } + return _SUBTYPES_WALKER.walk(supertype); + } + + + private static class RolePlayerWalker { + + private final Locator _assocTypeLoc; + private final Locator _rolePlayingTypeLoc; + private final Locator _otherRoleTypeLoc; + + public RolePlayerWalker(Locator associationType, Locator rolePlayingType, Locator otherRoleType) { + _assocTypeLoc = associationType; + _rolePlayingTypeLoc = rolePlayingType; + _otherRoleTypeLoc = otherRoleType; + } + + /** + * Walks through the association players and reports those which are + * playing the counterpart role. + * + * @param start The starting point. + * @return A colleciton of topics. + */ + public Set<Topic> walk(Topic start) { + return _walk(start, null); + } + + /** + * Returns if <tt>start</tt> is associated with <tt>end</tt>. + * + * @param start The starting point. + * @param end The end point. + * @return <tt>true</tt> if the start topic is associated with the end topic. + */ + public boolean isAssociated(Topic start, Topic end) { + return _walk(start, end).contains(end); + } + + /** + * Walks through the players. + * + * @param start The starting topic, must not be <tt>null</tt>. + * @param end The end topic, maybe <tt>null</tt>. + * @return A collection of topics. + */ + public Set<Topic> _walk(Topic start, Topic end) { + final TopicMap tm = start.getTopicMap(); + final Topic assocType = tm.getTopicBySubjectIdentifier(_assocTypeLoc); + final Topic rolePlayingType = tm.getTopicBySubjectIdentifier(_rolePlayingTypeLoc); + final Topic otherRoleType = tm.getTopicBySubjectIdentifier(_otherRoleTypeLoc); + if (assocType == null + || rolePlayingType == null + || otherRoleType == null) { + return Collections.emptySet(); + } + Set<Topic> players = new HashSet<Topic>(); + _walk(start, players, end, assocType, rolePlayingType, otherRoleType); + return players; + } + + private void _walk(Topic start, Set<Topic> result, Topic goal, Topic assocType, Topic rolePlayingType, Topic otherRoleType) { + for (Role role: start.getRolesPlayed(rolePlayingType, assocType)) { + IAssociation parent = (IAssociation) role.getParent(); + if (!parent.getScopeObject().isUnconstrained()) { + continue; + } + Set<Role> roles = role.getParent().getRoles(); + if (roles.size() != 2) { + continue; + } + for (Role r: roles) { + if (!r.getType().equals(otherRoleType)) { + continue; + } + Topic player = r.getPlayer(); + if (goal != null && player.equals(goal)) { + result.add(goal); + // No need to walk further + return; + } + else if (!result.contains(player)) { + result.add(player); + _walk(player, result, goal, assocType, rolePlayingType, otherRoleType); + } + } + } + } + } + + +} Property changes on: tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceUtils.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim/trunk/src/test/java/org/tinytim/utils/TestTypeInstanceUtils.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/utils/TestTypeInstanceUtils.java (rev 0) +++ tinytim/trunk/src/test/java/org/tinytim/utils/TestTypeInstanceUtils.java 2009-03-26 09:24:44 UTC (rev 293) @@ -0,0 +1,148 @@ +/* + * Copyright 2008 - 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.utils; + +import java.util.Collection; + +import org.tinytim.core.TinyTimTestCase; +import org.tinytim.voc.TMDM; + +import org.tmapi.core.Association; +import org.tmapi.core.Topic; +import org.tmapi.core.Typed; + +/** + * Tests against the {@link TypeInstanceUtils}. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class TestTypeInstanceUtils extends TinyTimTestCase { + + private void _testTypedInstanceOf(final Typed typed) { + assertNotNull(typed.getType()); + final Topic origType = typed.getType(); + final Topic newType = createTopic(); + assertTrue(TypeInstanceUtils.isInstanceOf(typed, origType)); + assertFalse(TypeInstanceUtils.isInstanceOf(typed, newType)); + typed.setType(newType); + assertFalse(TypeInstanceUtils.isInstanceOf(typed, origType)); + assertTrue(TypeInstanceUtils.isInstanceOf(typed, newType)); + final Topic supertype = createTopic(); + assertFalse(TypeInstanceUtils.isInstanceOf(typed, supertype)); + _makeSupertypeSubtype(newType, supertype); + assertTrue(TypeInstanceUtils.isInstanceOf(typed, supertype)); + final Topic supersupertype = createTopic(); + assertFalse(TypeInstanceUtils.isInstanceOf(typed, supersupertype)); + _makeSupertypeSubtype(supertype, supersupertype); + assertTrue(TypeInstanceUtils.isInstanceOf(typed, supersupertype)); + } + + private void _makeSupertypeSubtype(Topic subtype, Topic supertype) { + Association assoc = _tm.createAssociation(_tm.createTopicBySubjectIdentifier(TMDM.SUPERTYPE_SUBTYPE)); + assoc.createRole(_tm.createTopicBySubjectIdentifier(TMDM.SUPERTYPE), supertype); + assoc.createRole(_tm.createTopicBySubjectIdentifier(TMDM.SUBTYPE), subtype); + } + + public void testAssociation() { + _testTypedInstanceOf(createAssociation()); + } + + public void testRole() { + _testTypedInstanceOf(createRole()); + } + + public void testOccurrence() { + _testTypedInstanceOf(createOccurrence()); + } + + public void testName() { + _testTypedInstanceOf(createName()); + } + + /** + * Tests if a topic is an instance of itself. + */ + public void testIsInstanceOfSelf() { + final Topic topic = createTopic(); + assertFalse(TypeInstanceUtils.isInstanceOf(topic, topic)); + } + + /** + * Tests if a topic is an instance of the types returned by + * {@link Topic#getTypes()}. + */ + public void testIsInstanceOfTypes() { + final Topic topic = createTopic(); + final Topic type = createTopic(); + topic.addType(type); + assertTrue(topic.getTypes().contains(type)); + assertTrue(TypeInstanceUtils.isInstanceOf(topic, type)); + } + + public void testTopicIsInstanceOf() { + final Topic topic = createTopic(); + final Topic type1 = createTopic(); + final Topic type2 = createTopic(); + topic.addType(type1); + assertTrue(topic.getTypes().contains(type1)); + assertFalse(topic.getTypes().contains(type2)); + assertTrue(TypeInstanceUtils.isInstanceOf(topic, type1)); + assertFalse(TypeInstanceUtils.isInstanceOf(topic, type2)); + _makeSupertypeSubtype(type1, type2); + assertTrue(TypeInstanceUtils.isInstanceOf(topic, type2)); + final Topic type3 = createTopic(); + assertFalse(TypeInstanceUtils.isInstanceOf(topic, type3)); + _makeSupertypeSubtype(type2, type3); + assertTrue(TypeInstanceUtils.isInstanceOf(topic, type3)); + } + + public void testGetSupertypesSubtypes() { + final Topic sub = createTopic(); + final Topic super1 = createTopic(); + final Topic super2 = createTopic(); + Collection<Topic> supertypes = TypeInstanceUtils.getSupertypes(sub); + Collection<Topic> subtypes1 = TypeInstanceUtils.getSubtypes(super1); + Collection<Topic> subtypes2 = TypeInstanceUtils.getSubtypes(super2); + assertEquals(0, supertypes.size()); + assertEquals(0, subtypes1.size()); + assertEquals(0, subtypes2.size()); + // sub ako super1 + _makeSupertypeSubtype(sub, super1); + supertypes = TypeInstanceUtils.getSupertypes(sub); + subtypes1 = TypeInstanceUtils.getSubtypes(super1); + subtypes2 = TypeInstanceUtils.getSubtypes(super2); + assertEquals(1, supertypes.size()); + assertTrue(supertypes.contains(super1)); + assertEquals(1, subtypes1.size()); + assertTrue(subtypes1.contains(sub)); + assertEquals(0, subtypes2.size()); + // super1 ako super2 + _makeSupertypeSubtype(super1, super2); + supertypes = TypeInstanceUtils.getSupertypes(sub); + subtypes1 = TypeInstanceUtils.getSubtypes(super1); + subtypes2 = TypeInstanceUtils.getSubtypes(super2); + assertEquals(2, supertypes.size()); + assertTrue(supertypes.contains(super1)); + assertTrue(supertypes.contains(super2)); + assertEquals(1, subtypes1.size()); + assertTrue(subtypes1.contains(sub)); + assertEquals(2, subtypes2.size()); + assertTrue(subtypes2.contains(sub)); + assertTrue(subtypes2.contains(super1)); + } + +} Property changes on: tinytim/trunk/src/test/java/org/tinytim/utils/TestTypeInstanceUtils.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-13 15:08:45
|
Revision: 292 http://tinytim.svn.sourceforge.net/tinytim/?rev=292&view=rev Author: lheuer Date: 2009-03-13 15:08:25 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Updated CHANGES.txt Modified Paths: -------------- tinytim-mio/trunk/CHANGES.txt Modified: tinytim-mio/trunk/CHANGES.txt =================================================================== --- tinytim-mio/trunk/CHANGES.txt 2009-03-13 12:38:54 UTC (rev 291) +++ tinytim-mio/trunk/CHANGES.txt 2009-03-13 15:08:25 UTC (rev 292) @@ -10,6 +10,9 @@ Bugfixes: --------- +* XTM 2.0 importer sets the reifier of a merged-in topic map to + the master topic map. Correct behaviour: Just import the topic but + loose the reified topic map. * Validation of XTM 1.0 and 2.0 sources against a RELAX-NG schema did not work in all cases, fixed in "semagia-mio-xtm-0.9.4.jar" * XTM 1.0 <mergeMap/> didn't work, fixed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-13 12:39:09
|
Revision: 291 http://tinytim.svn.sourceforge.net/tinytim/?rev=291&view=rev Author: lheuer Date: 2009-03-13 12:38:54 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Updated LTM lib: In non-legacy mode, the reifier of an included / merged-in topic map is not assigned to the master topic map Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.4.jar Modified: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.4.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-12 15:00:10
|
Revision: 290 http://tinytim.svn.sourceforge.net/tinytim/?rev=290&view=rev Author: lheuer Date: 2009-03-12 15:00:00 +0000 (Thu, 12 Mar 2009) Log Message: ----------- - Fixed mergeMap bug in XTM 2.0 (reifier of the "child" tm was set to the master tm) Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.4.jar Modified: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.4.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-11 15:00:29
|
Revision: 289 http://tinytim.svn.sourceforge.net/tinytim/?rev=289&view=rev Author: lheuer Date: 2009-03-11 15:00:12 +0000 (Wed, 11 Mar 2009) Log Message: ----------- - Added XTM10Utils tests - TMCL vocabulary - TMCL namespace added Modified Paths: -------------- tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java tinytim/trunk/src/main/java/org/tinytim/voc/Namespace.java Added Paths: ----------- tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java tinytim/trunk/src/test/java/org/tinytim/utils/TestXTM10Utils.java Modified: tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java 2009-03-10 15:31:31 UTC (rev 288) +++ tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java 2009-03-11 15:00:12 UTC (rev 289) @@ -31,6 +31,10 @@ */ public class XTM10Utils { + private XTM10Utils() { + // noop. + } + private static final Logger LOG = Logger.getLogger(XTM10Utils.class.getName()); /** Modified: tinytim/trunk/src/main/java/org/tinytim/voc/Namespace.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/voc/Namespace.java 2009-03-10 15:31:31 UTC (rev 288) +++ tinytim/trunk/src/main/java/org/tinytim/voc/Namespace.java 2009-03-11 15:00:12 UTC (rev 289) @@ -48,6 +48,11 @@ public static final String TMDM_MODEL = "http://psi.topicmaps.org/iso13250/model/"; /** + * TMCL namespace (<tt>http://psi.topicmaps.org/tmcl/</tt>) + */ + public static final String TMCL = "http://psi.topicmaps.org/tmcl/"; + + /** * XTM 2.0 namespace (<tt>http://www.topicmaps.org/xtm/</tt>). */ public static final String XTM_20 = "http://www.topicmaps.org/xtm/"; Added: tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java 2009-03-11 15:00:12 UTC (rev 289) @@ -0,0 +1,127 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.voc; + +import org.tmapi.core.Locator; + +/** + * Constants for TMCL PSIs. + * <p> + * These PSIs are not stable yet. + * </p> + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev$ - $Date$ + */ +public final class TMCL extends Vocabulary { + + private TMCL() { + // noop. + } + + private static final String _BASE = Namespace.TMCL; + + // Topic types + + public static final Locator TOPIC_TYPE = _createLocator(_BASE + "topictype"); + + public static final Locator ASSOCIATION_TYPE = _createLocator(_BASE + "associationtype"); + + public static final Locator ROLE_TYPE = _createLocator(_BASE + "roletype"); + + public static final Locator OCCURRENCE_TYPE = _createLocator(_BASE + "occurrencetype"); + + public static final Locator NAME_TYPE = _createLocator(_BASE + "nametype"); + + public static final Locator SCOPE_TYPE = _createLocator(_BASE + "scopetype"); + + + // Role types + + public static final Locator TOPIC_TYPE_ROLE = _createLocator(_BASE + "topictype-role"); + + public static final Locator ASSOCIATION_TYPE_ROLE = _createLocator(_BASE + "associationtype-role"); + + public static final Locator ROLE_TYPE_ROLE = _createLocator(_BASE + "roletype-role"); + + public static final Locator OTHERROLE_TYPE_ROLE = _createLocator(_BASE + "roletype-role"); + + public static final Locator OCCURRENCE_TYPE_ROLE = _createLocator(_BASE + "occurrencetype-role"); + + public static final Locator NAME_TYPE_ROLE = _createLocator(_BASE + "nametype-role"); + + public static final Locator SCOPE_TYPE_ROLE = _createLocator(_BASE + "scopetype-role"); + + public static final Locator CONSTRAINT_ROLE = _createLocator(_BASE + "constraint-role"); + + + // Model topics + public static final Locator CONSTRAINT = _createLocator(_BASE + "constraint"); + + public static final Locator VALIDATION_EXPRESSION = _createLocator(_BASE + "validation-expression"); + + public static final Locator APPLIES_TO = _createLocator(_BASE + "applies-to"); + + public static final Locator CARD_MIN = _createLocator(_BASE + "card-min"); + + public static final Locator CARD_MAX = _createLocator(_BASE + "card-max"); + + //TODO: TMCL uses sometimes "regexp" and sometimes "reg-exp" + public static final Locator REGEXP = _createLocator(_BASE + "reg-exp"); + + public static final Locator DATATYPE = _createLocator(_BASE + "datatype"); + + + // Constraint types + public static final Locator TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "topictype-constraint"); + + public static final Locator ASSOCIATION_TYPE_CONSTRAINT = _createLocator(_BASE + "associationtype-constraint"); + + public static final Locator ROLE_TYPE_CONSTRAINT = _createLocator(_BASE + "roletype-constraint"); + + public static final Locator OCCURRENCE_TYPE_CONSTRAINT = _createLocator(_BASE + "occurrencetype-constraint"); + + public static final Locator NAME_TYPE_CONSTRAINT = _createLocator(_BASE + "nametype-constraint"); + + public static final Locator ABSTRACT_TOPIC_TYPE_CONSTRAINT = _createLocator(_BASE + "abstract-topictype-constraint"); + + public static final Locator EXCLUSIVE_INSTANCE = _createLocator(_BASE + "exclusive-instance"); + + public static final Locator SUBJECT_IDENTIFIER_CONSTRAINT = _createLocator(_BASE + "subjectidentifier-constraint"); + + public static final Locator SUBJECT_LOCATOR_CONSTRAINT = _createLocator(_BASE + "subjectlocator-constraint"); + + public static final Locator NAME_CONSTRAINT = _createLocator(_BASE + "topicname-constraint"); + + public static final Locator NAME_TYPE_SCOPE_CONSTRAINT = _createLocator(_BASE + "nametypescope-constraint"); + + public static final Locator OCCURRENCE_TYPE_SCOPE_CONSTRAINT = _createLocator(_BASE + "occurrencetypescope-constraint"); + + public static final Locator OCCURRENCE_DATATYPE_CONSTRAINT = _createLocator(_BASE + "occurrencedatatype-constraint"); + + public static final Locator ASSOCIATION_TYPE_SCOPE_CONSTRAINT = _createLocator(_BASE + "associationtypescope-constraint"); + + public static final Locator ASSOCIATION_ROLE_CONSTRAINT = _createLocator(_BASE + "associationrole-constraint"); + + public static final Locator ROLE_PLAYER_CONSTRAINT = _createLocator(_BASE + "roleplayer-constraint"); + + public static final Locator OTHERROLE_CONSTRAINT = _createLocator(_BASE + "otherrole-constraint"); + + public static final Locator TOPIC_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "topicoccurrence-constraint"); + + public static final Locator UNIQUE_OCCURRENCE_CONSTRAINT = _createLocator(_BASE + "uniqueoccurrence-constraint"); + +} Property changes on: tinytim/trunk/src/main/java/org/tinytim/voc/TMCL.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim/trunk/src/test/java/org/tinytim/utils/TestXTM10Utils.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/utils/TestXTM10Utils.java (rev 0) +++ tinytim/trunk/src/test/java/org/tinytim/utils/TestXTM10Utils.java 2009-03-11 15:00:12 UTC (rev 289) @@ -0,0 +1,82 @@ +/* + * Copyright 2008 - 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.utils; + +import org.tinytim.core.TinyTimTestCase; +import org.tmapi.core.Locator; +import org.tmapi.core.Name; +import org.tmapi.core.Reifiable; +import org.tmapi.core.Topic; + +/** + * Tests against the {@link XTM10Utils}. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class TestXTM10Utils extends TinyTimTestCase { + + private void _testConvertReification(Reifiable reifiable) { + final Locator loc = _tm.createLocator("http://www.semagia.com/test"); + Topic t = _tm.createTopicBySubjectIdentifier(loc); + reifiable.addItemIdentifier(loc); + assertNull(reifiable.getReifier()); + assertNull(t.getReified()); + assertEquals(1, t.getSubjectIdentifiers().size()); + assertEquals(loc, t.getSubjectIdentifiers().iterator().next()); + assertEquals(1, reifiable.getItemIdentifiers().size()); + assertEquals(loc, reifiable.getItemIdentifiers().iterator().next()); + XTM10Utils.convertReification(_tm); + assertEquals(t, reifiable.getReifier()); + assertEquals(reifiable, t.getReified()); + assertEquals(0, t.getSubjectIdentifiers().size()); + assertEquals(0, reifiable.getItemIdentifiers().size()); + reifiable.setReifier(null); + t.remove(); + } + + public void testConvertReification() { + _testConvertReification(_tm); + _testConvertReification(createAssociation()); + _testConvertReification(createRole()); + _testConvertReification(createOccurrence()); + _testConvertReification(createName()); + _testConvertReification(createVariant()); + } + + public void testConvertReificationSkipReified() { + final Locator loc = _tm.createLocator("http://www.semagia.com/test"); + Topic t = _tm.createTopicBySubjectIdentifier(loc); + Name reifiedName = createName(); + reifiedName.setReifier(t); + assertEquals(t, reifiedName.getReifier()); + assertEquals(reifiedName, t.getReified()); + Name name = createName(); + name.addItemIdentifier(loc); + assertEquals(1, t.getSubjectIdentifiers().size()); + assertEquals(loc, t.getSubjectIdentifiers().iterator().next()); + assertEquals(1, name.getItemIdentifiers().size()); + assertEquals(loc, name.getItemIdentifiers().iterator().next()); + XTM10Utils.convertReification(_tm); + assertEquals(t, reifiedName.getReifier()); + assertEquals(reifiedName, t.getReified()); + assertEquals(1, t.getSubjectIdentifiers().size()); + assertEquals(loc, t.getSubjectIdentifiers().iterator().next()); + assertEquals(1, name.getItemIdentifiers().size()); + assertEquals(loc, name.getItemIdentifiers().iterator().next()); + } + +} Property changes on: tinytim/trunk/src/test/java/org/tinytim/utils/TestXTM10Utils.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-10 15:31:50
|
Revision: 288 http://tinytim.svn.sourceforge.net/tinytim/?rev=288&view=rev Author: lheuer Date: 2009-03-10 15:31:31 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Removed old CXTM subproject, it is part of tinytim.mio now (even for 1.5) Removed Paths: ------------- tinytim-cxtm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-10 14:35:33
|
Revision: 287 http://tinytim.svn.sourceforge.net/tinytim/?rev=287&view=rev Author: lheuer Date: 2009-03-10 14:35:23 +0000 (Tue, 10 Mar 2009) Log Message: ----------- - Added jill.ctm (source: jill.xtm) - Updated opera.ctm and pokemon.ctm (sources were read by the new LTM reader without legacy reifier handling) Modified Paths: -------------- topicmaps/opera.ctm topicmaps/pokemon.ctm Added Paths: ----------- topicmaps/jill.ctm Added: topicmaps/jill.ctm =================================================================== --- topicmaps/jill.ctm (rev 0) +++ topicmaps/jill.ctm 2009-03-10 14:35:23 UTC (rev 287) @@ -0,0 +1,265 @@ +%encoding "utf-8" +%version 1.0 + +#( +Title: Jill's First Topic Map +Author: Ontopia + +This version was automatically converted by tinyTiM from the topic map encoded in XTM + +$Rev:$ - $Date:$ + +Generated by tinyTiM -- http://tinytim.sourceforge.net/ + +)# + +#-- Prefixes +%prefix dc <http://purl.org/dc/elements/1.1/> +%prefix jill <http://psi.ontopia.net/jill/#> +%prefix meta <http://psi.ontopia.net/metadata/#> + + + +#-- Topic Map +~ jillstm-topic + +jillstm-topic - "Jill's First Topic Map"; + - "Jill's 1st TM" @short-name; + Date: "$Date: 2004/06/29 01:34:39 $"; + Description: "Example topic map from Omnigator User Guide."; + Rights: "(C) Copyright 2003 Ontopia". + + +#-- ONTOLOGY + + +#-- Topic Types + + +#-- TT: [untyped] + +Format - "Format"; + dc:format. + +Type - "Type"; + dc:type. + +company - "Company"; + <http://psi.ontopia.net/xmltools/#Company>. + +contract - "Contract"; + jill:contract. + +description - "Description"; + <http://psi.ontopia.net/xtm/occurrence-type/description>. + +developer - "Developer"; + jill:developer. + +employment - "Employment"; + - "Employed by" @employee; + - "Employs" @employer; + jill:employment. + +website - "Web site"; + jill:website. + + +#-- Association Types + + +#-- TT: [untyped] + +Creator - "Creator"; + dc:creator. + +Format - "Format"; + dc:format. + +Language - "Language"; + dc:language. + +Publisher - "Publisher"; + dc:publisher. + +Subject - "Subject"; + dc:subject. + +Type - "Type"; + dc:type. + +employment - "Employment"; + - "Employed by" @employee; + - "Employs" @employer; + jill:employment. + + +#-- Role Types + + +#-- TT: [untyped] + +employee - "Employee". + +employer - "Employer". + +resource - "Resource"; + meta:resource. + +value - "Value"; + meta:value. + + +#-- Occurrence Types + + +#-- TT: [untyped] + +Date - "Date"; + dc:date. + +Description - "Description"; + dc:description. + +Rights - "Rights"; + dc:rights. + +contract - "Contract"; + jill:contract. + +website - "Web site"; + jill:website. + + +#-- TT: description + +kudo isa description; + - "Kudo". + + +#-- Name Themes + + +#-- TT: [untyped] + +employee - "Employee". + +employer - "Employer". + +short-name - "Short name"; + <http://psi.ontopia.net/basename/#short-name>. + + + +#-- INSTANCES + + +#-- Topics + + +#-- TT: [untyped] + +Contributor - "Contributor"; + dc:contributor. + +Coverage - "Coverage"; + dc:coverage. + +Identifier - "Identifier"; + dc:identifier. + +Relation - "Relation"; + dc:relation. + +Source - "Source"; + dc:source. + +Title - "Title"; + dc:title. + +english - "English"; + <http://www.topicmaps.org/xtm/1.0/language.xtm#en>. + +pepper - "Steve Pepper"; + <http://psi.ontopia.net/ontopia/#pepper>. + + +#-- TT: Format + +AsTMa-format isa Format; + - "AsTMa"; + meta:AsTMa. + +HyTM-format isa Format; + - "HyTM"; + meta:HyTM. + +LTM-format isa Format; + - "LTM"; + meta:LTM. + +XTM-format isa Format; + - "XTM"; + meta:XTM. + + +#-- TT: Type + +topicmap-type isa Type; + - "Topic Map"; + meta:topicmap. + + +#-- TT: company + +ontopia isa company; + - "Ontopia"; + website: <http://www.ontopia.net/>; + <http://psi.ontopia.net/ontopia/#ontopia>. + + +#-- TT: contract + +jills-contract-topic isa contract; + - "Jill's contract with Ontopia"; + contract: <http://www.ontopia.net/internal/employees/contracts/jill.htm>. + + +#-- TT: developer + +jill isa developer; + - "Jill Hacker"; + kudo: "Jill's a cool girl and a great hacker". + + +#-- TT: employment + +jill-ontopia-topic isa employment; + - "Jill's position with Ontopia"; + contract: <http://www.ontopia.net/internal/employees/contracts/jill.htm> ~ jills-contract-topic. + + +#-- TT: website + +ontopias-website isa website; + - "Ontopia's Web Site"; + = <http://www.ontopia.net/>. + + +#-- Associations + +Creator(resource: jillstm-topic, value: pepper) + +Format(resource: jillstm-topic, value: XTM-format) + +Language(resource: jillstm-topic, value: english) + +Publisher(resource: jillstm-topic, value: ontopia) + +Subject(resource: jillstm-topic, value: ontopia) + +Type(resource: jillstm-topic, value: topicmap-type) + +employment(employee: jill, employer: ontopia) ~ jill-ontopia-topic + +# Thanks for using tinyTiM -- http://tinytim.sourceforge.net/ :) Modified: topicmaps/opera.ctm =================================================================== --- topicmaps/opera.ctm 2009-03-10 14:32:55 UTC (rev 286) +++ topicmaps/opera.ctm 2009-03-10 14:35:23 UTC (rev 287) @@ -44,8 +44,7 @@ Date: "$Date: 2006/10/27 12:16:15 $"; Description: "This topic map was originally written to help me understand various aspects of the Topic Maps standard, and to be able to experiment with different modeling approaches. Latterly it has served as a test bed for Ontopia's topic map engine and other components of the Ontopia Knowledge Suite, and therefore contains a number of weird and wonderful constructs (including some bugs we know about, and maybe some we don't!). As of July 2006 it is maintained in LTM syntax. An XTM 1.0 version can be generated using the Export plug-in of the Omnigator."; Rights: "Copyright (c) 1999-2006, Steve Pepper. This topic map may be freely distributed and used for any purpose, commercial or non-commercial, provided that it is not modified in any way and that this copyright notice is left intact."; - revision: "$Revision: 1.8 $"; - <#--reified--operatm>. + revision: "$Revision: 1.8 $". #-- ONTOLOGY @@ -1657,16 +1656,14 @@ xtm:display. la-tilda-libretto-by - "The librettist of La Tilde"; - descr: "The libretto was written by Zanardini under the pseudonym Anneldo Graziani."; - <#--reified--la-tilda-libretto-by>. + descr: "The libretto was written by Zanardini under the pseudonym Anneldo Graziani.". literary-work - "Literary work"; - "Litterært verk" @norwegian; lit:literary-work. madama-butterfly-based-on - "The genesis of Madame Butterfly"; - bibref: """van Rij, Jan: "Madame Butterfly: Japonisme, Puccini, and the search for the real Cho-Cho-San", Stone Bridge Press (Berkeley, 2001)"""; - <#--reified--madama-butterfly-based-on>. + bibref: """van Rij, Jan: "Madame Butterfly: Japonisme, Puccini, and the search for the real Cho-Cho-San", Stone Bridge Press (Berkeley, 2001)""". musical-work - "Musical work"; - "Musikalsk verk" @norwegian; @@ -1680,7 +1677,6 @@ <http://psi.ontopia.net/organization>. pauld-website - "Opera: A Philatelic History"; - <#--reified--pauld-website>; = <http://home.prcn.org/~pauld/opera/>. pepper - "Steve Pepper"; @@ -1695,13 +1691,11 @@ lit:theatrical-work. tosca-takes-place-in - "The setting of Tosca in Rome"; - bibref: """Nicassio, Susan Vandiver: "Tosca's Rome: The Play and the Opera in Historical Perspective", University of Chicago Press (Chicago, 2002)"""; - <#--reified--tosca-takes-place-in>. + bibref: """Nicassio, Susan Vandiver: "Tosca's Rome: The Play and the Opera in Historical Perspective", University of Chicago Press (Chicago, 2002)""". turandot-takes-place-in - "Turandot performed in the Forbidden City"; article: <http://www.sallys-place.com/travel/asia/beijing.htm> @web; - website: <http://www.turandotonsite.com/> @web; - <#--reified--turandot-takes-place-in>. + website: <http://www.turandotonsite.com/> @web. #-- TT: Format Modified: topicmaps/pokemon.ctm =================================================================== --- topicmaps/pokemon.ctm 2009-03-10 14:32:55 UTC (rev 286) +++ topicmaps/pokemon.ctm 2009-03-10 14:35:23 UTC (rev 287) @@ -28,7 +28,6 @@ unofficial-site: "Pokemon Village Pokedex: http://www.pokemonvillage.com/pokedex/"; unofficial-site: "The Original Pojodex: http://www.pojo.com/pokedex/pokedex-Original.html"; version: "Revision: 1.3 "; - <#--reified--pokemon>; <#pokemon>. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-10 14:33:09
|
Revision: 286 http://tinytim.svn.sourceforge.net/tinytim/?rev=286&view=rev Author: lheuer Date: 2009-03-10 14:32:55 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Updated CHANGES.txt and build scripts Modified Paths: -------------- tinytim-mio/trunk/CHANGES.txt tinytim-mio/trunk/build-15.xml tinytim-mio/trunk/build.xml Modified: tinytim-mio/trunk/CHANGES.txt =================================================================== --- tinytim-mio/trunk/CHANGES.txt 2009-03-10 14:28:29 UTC (rev 285) +++ tinytim-mio/trunk/CHANGES.txt 2009-03-10 14:32:55 UTC (rev 286) @@ -2,15 +2,17 @@ Changes Log =========== -2.0.0 a4 SP1 (xx.02.2008) -------------------------- +2.0.0 a5 (xx.03.2009) +--------------------- * JTMTopicMapReader / JTMTopicMapWriter implement the new JSON Topic Maps specification (<http://www.cerny-online.com/jtm/1.0/> +* LTMTopicMapReader: Configurable reification handling Bugfixes: --------- * Validation of XTM 1.0 and 2.0 sources against a RELAX-NG schema - did not work in all cases, fixed in "semagia-mio-xtm-0.9.3-sp1.jar" + did not work in all cases, fixed in "semagia-mio-xtm-0.9.4.jar" +* XTM 1.0 <mergeMap/> didn't work, fixed * Bug #2560821 -- XTM 1.0 serializer uses wrong element for type reported by Jens Rummler * Bug #2540490 -- Using QName in isa/ako throws syntax error Modified: tinytim-mio/trunk/build-15.xml =================================================================== --- tinytim-mio/trunk/build-15.xml 2009-03-10 14:28:29 UTC (rev 285) +++ tinytim-mio/trunk/build-15.xml 2009-03-10 14:32:55 UTC (rev 286) @@ -12,7 +12,7 @@ <property name="lib.tmapi" value="${dir.lib}/tmapi-1_0SP1.jar"/> <property name="lib.tinytim" value="${dir.lib}/tinytim-1.5.0b2.jar"/> <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.6.jar"/> - <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.3.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/> <target name="help"> <echo message="------------------------"/> Modified: tinytim-mio/trunk/build.xml =================================================================== --- tinytim-mio/trunk/build.xml 2009-03-10 14:28:29 UTC (rev 285) +++ tinytim-mio/trunk/build.xml 2009-03-10 14:32:55 UTC (rev 286) @@ -13,7 +13,7 @@ <property name="lib.tinytim" value="${dir.lib}/tinytim-2.0.0a4.jar"/> <property name="lib.tinytim.tests" value="${dir.lib}/tinytim-2.0.0a4-tests.jar"/> <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.6.jar"/> - <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.3.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/> <target name="help"> <echo message="------------------------"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-10 14:28:38
|
Revision: 285 http://tinytim.svn.sourceforge.net/tinytim/?rev=285&view=rev Author: lheuer Date: 2009-03-10 14:28:29 +0000 (Tue, 10 Mar 2009) Log Message: ----------- Added XTM10Utils to convert XTM 1.0 reification to TMDM reification Added Paths: ----------- tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java Added: tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java 2009-03-10 14:28:29 UTC (rev 285) @@ -0,0 +1,75 @@ +/* + * Copyright 2008 - 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.utils; + +import java.util.logging.Logger; + +import org.tmapi.core.Construct; +import org.tmapi.core.Locator; +import org.tmapi.core.Reifiable; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; + +/** + * Utility functions to convert XTM 1.0 legacy features into the TMDM equivalent. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class XTM10Utils { + + private static final Logger LOG = Logger.getLogger(XTM10Utils.class.getName()); + + /** + * Converts the XTM 1.0 reification mechanism into TMDM reification. + * <p> + * In XTM 1.0 a construct was reified if it has a source locator (item + * identifier) equals to a subject identifier of a topic. In TMDM, the + * reification of constructs modelled as a property. + * </p> + * <p> + * This function converts the XTM 1.0 reification mechansim into the TMDM + * reification mechanism by setting the property of reified constructs to + * the reifying topic. The item identifier and subject identifier which + * establish the XTM 1.0 reification will be removed. + * </p> + * + * @param topicMap The {@link TopicMap} to convert. + */ + public static void convertReification(final TopicMap topicMap) { + for (Topic topic: topicMap.getTopics()) { + if (topic.getReified() != null) { + continue; + } + for (Locator sid: topic.getSubjectIdentifiers()) { + Construct construct = (Construct) topicMap.getConstructByItemIdentifier(sid); + if (construct == null || construct instanceof Topic) { + continue; + } + Reifiable reifiable = (Reifiable) construct; + if (reifiable.getReifier() != null) { + LOG.info("Skipping reifiable construct " + reifiable.getId() + " since it is reified"); + continue; + } + reifiable.setReifier(topic); + reifiable.removeItemIdentifier(sid); + topic.removeSubjectIdentifier(sid); + break; + } + } + } + +} Property changes on: tinytim/trunk/src/main/java/org/tinytim/utils/XTM10Utils.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-10 14:27:17
|
Revision: 284 http://tinytim.svn.sourceforge.net/tinytim/?rev=284&view=rev Author: lheuer Date: 2009-03-10 14:27:07 +0000 (Tue, 10 Mar 2009) Log Message: ----------- - XMLWriter adds newline even even if depth == 0 if prettify is enabled - AbstractTopicMapReader: added method which gets called if parsing was successful - LTMTopicMapReader: Added configurable reifier handling, added docs - LTM lib: Added configurable reifier handling - XTM lib: Fixed XTM 1.0 mergeMap bug (mergeMap works now) - MIO lib: Changed some internals but it is binary compatible to 0.9.3 Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLWriter.java Added Paths: ----------- tinytim-mio/trunk/lib/semagia-mio-0.9.4.jar tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.4.jar tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.4.jar Removed Paths: ------------- tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3-sp1.jar Deleted: tinytim-mio/trunk/lib/semagia-mio-0.9.3.jar =================================================================== (Binary files differ) Added: tinytim-mio/trunk/lib/semagia-mio-0.9.4.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-0.9.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.3.jar =================================================================== (Binary files differ) Added: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.4.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-ltm-0.9.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.3-sp1.jar =================================================================== (Binary files differ) Added: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.4.jar =================================================================== (Binary files differ) Property changes on: tinytim-mio/trunk/lib/semagia-mio-xtm-0.9.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java 2009-03-09 13:59:35 UTC (rev 283) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/AbstractTopicMapReader.java 2009-03-10 14:27:07 UTC (rev 284) @@ -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. @@ -129,6 +129,7 @@ public void read() throws IOException { try { _deserializer.parse(_source); + postProcess(); } catch (MIOException ex) { if (ex.getException() instanceof IOException) { @@ -142,4 +143,14 @@ _deserializer = null; } } + + /** + * Called if parsing has been finished without errors, does nothing by default. + * <p> + * The {@link #_deserializer} is still available. + * </p> + */ + protected void postProcess() { + // noop. + } } Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java 2009-03-09 13:59:35 UTC (rev 283) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/LTMTopicMapReader.java 2009-03-10 14:27:07 UTC (rev 284) @@ -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. @@ -21,6 +21,7 @@ import org.tmapi.core.TopicMap; +import com.semagia.mio.Property; import com.semagia.mio.Source; import com.semagia.mio.Syntax; @@ -41,6 +42,10 @@ * specified after an subject locator (if given); this implementation * does not mandate any order; a subject locator may be followed by an * subject identifier etc.</li> + * <li>Reification is handled directly without adding an additional item + * identifier to the reified construct and without adding an additional + * subject identifier to the reifier (unless this "feature" is enabled + * explicitely; c.f. {@link #setLegacyReifierHandling(boolean)}</li> * </ul> * </p> * @@ -100,49 +105,31 @@ super(topicMap, Syntax.LTM, source); } -// /** -// * Enables / disables processing of the "#MERGEMAP" directive. -// * <p> -// * The reader won't deserialize topic maps referenced by mergeMap if -// * this feature is enabled (disabled by default). -// * </p> -// * -// * @param ignore <tt>true</tt> to ignore "#MERGEMAP" directives, -// * otherwise <tt>false</tt>. -// */ -// public void setIgnoreMergeMap(boolean ignore) { -// _deserializer.setProperty(Property.IGNORE_MERGEMAP, ignore); -// } -// -// /** -// * Returns if this reader ignores "#MERGEMAP" directives. -// * -// * @return <tt>true</tt> if "#MERGEMAP" is ignored, otherwise <tt>false</tt>. -// */ -// public boolean isIgnoringMergeMap() { -// return Boolean.TRUE.equals(_deserializer.getProperty(Property.IGNORE_MERGEMAP)); -// } + /** + * Indicates if reified construct should receive an item identifier of the + * form <tt>uri-of-file#--reified--id</tt> and the reifying topic should + * receive a subject identifier of the same form. + * <p> + * By default this "feature" is disabled; the parser sets [reifier] property + * of the reified construct and does not add any additional IRIs. To be + * conform to the LTM specification, this feature has to be enabled even if + * it adds no value. + * </p> + * + * @param enable <tt>true</tt> to enable the legacy mode, otherwise <tt>false</tt>. + */ + public void setLegacyReifierHandling(boolean enable) { + _deserializer.setProperty(Property.XTM_10_LEGACY, Boolean.valueOf(enable)); + } -// /** -// * Enables / disables processing of the "#INCLUDE" directive. -// * <p> -// * The reader won't deserialize topic maps referenced by "#INCLUDE" if -// * this feature is enabled (disabled by default). -// * </p> -// * -// * @param ignore <tt>true</tt> to ignore "#INCLUDE" directives, -// * otherwise <tt>false</tt>. -// */ -// public void setIgnoreInclude(boolean ignore) { -// _deserializer.setProperty(Property.IGNORE_INCLUDE, ignore); -// } -// -// /** -// * Returns if this reader ignores "#INCLUDE" directives. -// * -// * @return <tt>true</tt> if "#INCLUDE" is ignored, otherwise <tt>false</tt>. -// */ -// public boolean isIgnoringInclude() { -// return Boolean.TRUE.equals(_deserializer.getProperty(Property.IGNORE_INCLUDE)); -// } + /** + * Indicates if the parser handles the reification of constructs in a legacy + * way. + * + * @return <tt>true</tt> if the parser is in legacy mode, otherwise <tt>false</tt>. + */ + public boolean getLegacyReifierHandling() { + return Boolean.TRUE.equals(_deserializer.getProperty(Property.XTM_10_LEGACY)); + } + } Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLWriter.java 2009-03-09 13:59:35 UTC (rev 283) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/XMLWriter.java 2009-03-10 14:27:07 UTC (rev 284) @@ -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. @@ -68,7 +68,9 @@ _out.write("\" standalone=\"yes\"?>"); _newline(); _out.write("<!-- Generated by tinyTiM - http://tinytim.sourceforge.net/ -->"); - _newline(); + if (!_prettify) { + _newline(); + } _depth = 0; } @@ -85,6 +87,9 @@ } } + /** + * Writes an element start with no attributes. + */ public void startElement(String name) throws IOException { startElement(name, EMPTY_ATTRS); } @@ -108,10 +113,7 @@ _endElement(name, true); } - /** - * @see org.xml.sax.DocumentHandler#endElement(java.lang.String) - */ - public void _endElement(String name, boolean indent) throws IOException { + private void _endElement(String name, boolean indent) throws IOException { _depth--; if (indent) { _indent(); @@ -139,7 +141,7 @@ _endElement(name, false); } - public void _writeAttributes(Attributes attrs) throws IOException { + private void _writeAttributes(Attributes attrs) throws IOException { char[] chars; for (int i=0; i < attrs.getLength(); i++) { _out.write(' '); @@ -164,9 +166,7 @@ if (!_prettify) { return; } - if (_depth > 0) { - _newline(); - } + _newline(); int indent = _depth*2; char[] chars = new char[indent]; for (int i=0; i<indent; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-09 13:59:51
|
Revision: 283 http://tinytim.svn.sourceforge.net/tinytim/?rev=283&view=rev Author: lheuer Date: 2009-03-09 13:59:35 +0000 (Mon, 09 Mar 2009) Log Message: ----------- - Updated Opera / Pokemon with prefixes and the topics are grouped by their type - Added mondial.ctm converted from a XTM source - Added DC Modified Paths: -------------- topicmaps/opera.ctm topicmaps/pokemon.ctm Added Paths: ----------- topicmaps/dc.ctm topicmaps/mondial.ctm Added: topicmaps/dc.ctm =================================================================== --- topicmaps/dc.ctm (rev 0) +++ topicmaps/dc.ctm 2009-03-09 13:59:35 UTC (rev 283) @@ -0,0 +1,116 @@ +%encoding "utf-8" +%version 1.0 + +#( +Title: Template for Dublin Core metadata + +This version was automatically converted by tinyTiM from the topic map encoded in LTM + +$Rev:$ - $Date:$ + +Generated by tinyTiM -- http://tinytim.sourceforge.net/ + +)# + +#-- Prefixes +%prefix dc <http://purl.org/dc/elements/1.1/> +%prefix meta <http://psi.ontopia.net/metadata/#> + + + +#-- ONTOLOGY + + +#-- Topic Types + + +#-- TT: [untyped] + +Format - "Format"; + dc:format. + +Type - "Type"; + dc:type. + + + +#-- INSTANCES + + +#-- Topics + + +#-- TT: [untyped] + +Contributor - "Contributor"; + dc:contributor. + +Coverage - "Coverage"; + dc:coverage. + +Creator - "Creator"; + dc:creator. + +Date - "Date"; + dc:date. + +Description - "Description"; + dc:description. + +Identifier - "Identifier"; + dc:identifier. + +Language - "Language"; + dc:language. + +Publisher - "Publisher"; + dc:publisher. + +Relation - "Relation"; + dc:relation. + +Rights - "Rights"; + dc:rights. + +Source - "Source"; + dc:source. + +Subject - "Subject"; + dc:subject. + +Title - "Title"; + dc:title. + +resource - "Resource"; + meta:resource. + +value - "Value"; + meta:value. + + +#-- TT: Format + +AsTMa-format isa Format; + - "AsTMa"; + meta:AsTMa. + +HyTM-format isa Format; + - "HyTM"; + meta:HyTM. + +LTM-format isa Format; + - "LTM"; + meta:LTM. + +XTM-format isa Format; + - "XTM"; + meta:XTM. + + +#-- TT: Type + +topicmap-type isa Type; + - "Topic Map"; + meta:topicmap. + +# Thanks for using tinyTiM -- http://tinytim.sourceforge.net/ :) Added: topicmaps/mondial.ctm =================================================================== --- topicmaps/mondial.ctm (rev 0) +++ topicmaps/mondial.ctm 2009-03-09 13:59:35 UTC (rev 283) @@ -0,0 +1,59876 @@ +%encoding "utf-8" +%version 1.0 + +#( +Title: Mondial +Author: Unknown, part of the OKS samplers + +This version was automatically converted by tinyTiM from the topic map encoded in XTM + +$Rev:$ - $Date:$ + +Generated by tinyTiM -- http://tinytim.sourceforge.net/ + +)# + +#-- Prefixes +%prefix geo <http://psi.ontopia.net/geography/#> + + + +#-- ONTOLOGY + + +#-- Topic Types + + +#-- TT: [untyped] + +city - "City"; + geo:city. + +continent - "Continent"; + geo:continent. + +country - "Country"; + <http://psi.oasis-open.org/iso/3166/#country>. + +desert - "Desert"; + geo:desert. + +ethnic-group - "Ethnic group"; + geo:ethnic-group. + +island - "Island"; + geo:island. + +lake - "Lake"; + geo:lake. + +mountain - "Mountain"; + geo:mountain. + +organization - "Organization"; + <http://xmlns.com/foaf/0.1/Organization>. + +province - "Province"; + geo:province. + +religion - "Religion"; + <http://psi.ontopia.net/mondial/#religion>. + +river - "River"; + geo:river. + +sea - "Sea"; + geo:sea. + + +#-- Association Types + + +#-- TT: [untyped] + +belongs-to - "Belongs to"; + - "Has jurisdiction over" @owner; + geo:belongs-to. + +borders-with - "Borders with"; + geo:borders-with. + +contained-in - "Contained in"; + - "Contains" @container; + geo:located-in. + +ends-in - "Ends in"; + - "Rivers running into" @end; + geo:runs-into. + +has-coast-to - "Has coast to"; + geo:has-coast-to. + +has-seat-in - "Seat in"; + - "Seated in" @organization; + - "Is seat of" @seat; + <http://psi.ontopia.net/mondial/#has-seat-in>. + +is-capital-of - "Is capital of"; + - "Has capital" @country; + geo:is-capital-of. + +lives-in - "Lives in"; + - "Has ethnic groups" @country; + geo:lives-in. + +located-by - "Located by"; + - "Cities by" @location; + geo:located-by. + +membership - "Membership"; + - "Member of" @member; + - "Has members" @organization; + <http://psi.ontopia.net/mondial/#member-of>. + +practised-in - "Practised in"; + - "Has religions" @country; + <http://psi.ontopia.net/mondial/#practiced-in>. + +runs-through - "Runs through"; + - "Has rivers" @region; + geo:runs-through. + + +#-- Role Types + + +#-- TT: [untyped] + +capital - "Capital". + +containee - "Containee". + +container - "Container". + +country - "Country"; + <http://psi.oasis-open.org/iso/3166/#country>. + +end - "End". + +ethnic-group - "Ethnic group"; + geo:ethnic-group. + +locatee - "Locatee". + +location - "Location". + +member - "Member". + +neighbour - "Neighbour". + +organization - "Organization"; + <http://xmlns.com/foaf/0.1/Organization>. + +owned - "Owned". + +owner - "Owner". + +region - "Region". + +religion - "Religion"; + <http://psi.ontopia.net/mondial/#religion>. + +river - "River"; + geo:river. + +sea - "Sea"; + geo:sea. + +seat - "Seat". + +source - "Source". + + +#-- Occurrence Types + + +#-- TT: [untyped] + +area - "Area". + +depth - "Depth". + +gdp-agri - "Agricultural GFP". + +gdp-total - "GDP". + +government - "Government". + +height - "Height". + +independence - "Independent on". + +inflation - "Inflation". + +latitude - "Latitude". + +length - "Length". + +longitude - "Longitude". + +pop-growth - "Population growth". + +population - "Population". + + +#-- Name Themes + + +#-- TT: [untyped] + +abbreviation - "Abbreviation". + +container - "Container". + +country - "Country"; + <http://psi.oasis-open.org/iso/3166/#country>. + +end - "End". + +location - "Location". + +member - "Member". + +organization - "Organization"; + <http://xmlns.com/foaf/0.1/Organization>. + +owner - "Owner". + +region - "Region". + +seat - "Seat". + + + +#-- INSTANCES + + +#-- Topics + + +#-- TT: [untyped] + +inf-mortality - "Infant mortality". + +river-Missouri_River_river-Mississippi_River . + +river-Ounasjoki_river-Kemijoki . + + +#-- TT: city + +cty-Afghanistan-Kabul isa city; + - "Kabul"; + latitude: "34.5833"; + longitude: "69.2"; + population: "892000". + +cty-Algeria-Algiers isa city; + - "Algiers"; + latitude: "36.7667"; + longitude: "30.05"; + population: "1507241". + +cty-Argentina-Buenos-Aires isa city; + - "Buenos Aires"; + latitude: "-34.5833"; + longitude: "-58.4833"; + population: "2988006". + +cty-Argentina-Cordoba isa city; + - "Cordoba"; + latitude: "-31.3667"; + longitude: "-64.25"; + population: "1208713". + +cty-Australia-Adelaide isa city; + - "Adelaide"; + latitude: "-34.9333"; + longitude: "138.583"; + population: "1050000". + +cty-Australia-Brisbane isa city; + - "Brisbane"; + latitude: "-27.4667"; + longitude: "153.033"; + population: "1302000". + +cty-Australia-Darwin isa city; + - "Darwin"; + latitude: "-12.4667"; + longitude: "130.85"; + population: "68500". + +cty-Australia-Melbourne isa city; + - "Melbourne"; + latitude: "-37.8167"; + longitude: "144.967"; + population: "3081000". + +cty-Australia-Perth isa city; + - "Perth"; + latitude: "-31.95"; + longitude: "115.85"; + population: "1193000". + +cty-Australia-Sydney isa city; + - "Sydney"; + latitude: "-33.8667"; + longitude: "151.2"; + population: "3657000". + +cty-Austria-Vienna isa city; + - "Vienna"; + latitude: "48.25"; + longitude: "16.3667"; + population: "1583000". + +cty-Bahamas-Nassau isa city; + - "Nassau"; + latitude: "25.0833"; + longitude: "-77.35"; + population: "140000". + +cty-Belarus-Minsk isa city; + - "Minsk"; + latitude: "53.9"; + longitude: "27.55"; + population: "1540000". + +cty-Bolivia-La-Paz isa city; + - "La Paz"; + latitude: "-16.5"; + longitude: "-68.15"; + population: "953400". + +cty-Brazil-Belem isa city; + - "Belem"; + latitude: "-1.45"; + longitude: "-48.4833"; + population: "1142258". + +cty-Brazil-Belo-Horizonte isa city; + - "Belo Horizonte"; + latitude: "-19.9333"; + longitude: "-43.95"; + population: "2091770". + +cty-Brazil-Brasilia isa city; + - "Brasilia"; + latitude: "-15.8667"; + longitude: "-47.9167"; + population: "1817001". + +cty-Brazil-Curitiba isa city; + - "Curitiba"; + latitude: "-25.4167"; + longitude: "-49.2833"; + population: "1465698". + +cty-Brazil-Fortaleza isa city; + - "Fortaleza"; + latitude: "-3.76667"; + longitude: "-38.55"; + population: "1967365". + +cty-Brazil-Porto-Alegre isa city; + - "Porto Alegre"; + latitude: "-30.0333"; + longitude: "-51.2167"; + population: "1286251". + +cty-Brazil-Recife isa city; + - "Recife"; + latitude: "-8.06667"; + longitude: "-34.8833"; + population: "1342877". + +cty-Brazil-Salvador isa city; + - "Salvador"; + latitude: "-13"; + longitude: "-38.5"; + population: "2209465". + +cty-Brazil-Sao-Paulo isa city; + - "Sao Paulo"; + latitude: "-23.55"; + longitude: "-46.6333"; + population: "9811776". + +cty-Bulgaria-Sofia isa city; + - "Sofia"; + latitude: "42.7"; + longitude: "23.3333"; + population: "1300000". + +cty-Burma-Mandalay isa city; + - "Mandalay"; + latitude: "21.9833"; + longitude: "96.1"; + population: "532900". + +cty-Burma-Rangoon isa city; + - "Rangoon"; + latitude: "16.7833"; + longitude: "96.15"; + population: "2513000". + +cty-Cambodia-Phnom-Penh isa city; + - "Phnom Penh"; + latitude: "11.55"; + longitude: "104.85"; + population: "400000". + +cty-Chile-Santiago isa city; + - "Santiago"; + latitude: "-33.45"; + longitude: "-70.7"; + population: "4318000". + +cty-China-Shanghai isa city; + - "Shanghai"; + latitude: "31.2"; + longitude: "121.433"; + population: "7830000". + +cty-Colombia-Bogota isa city; + - "Bogota"; + latitude: "4.6"; + longitude: "-74.0833"; + population: "5237635". + +cty-Colombia-Cali isa city; + - "Cali"; + latitude: "3.41667"; + longitude: "-76.5"; + population: "1718871". + +cty-Colombia-Medellin isa city; + - "Medellin"; + latitude: "6.21667"; + longitude: "-75.6"; + population: "1621356". + +cty-Congo-Brazzaville isa city; + - "Brazzaville"; + latitude: "-4.25"; + longitude: "15.25". + +cty-Cuba-Havana isa city; + - "Havana"; + latitude: "23.1333"; + longitude: "-82.35"; + population: "2241000". + +cty-Denmark-Copenhagen isa city; + - "Copenhagen"; + latitude: "55.6833"; + longitude: "12.55"; + population: "1358540". + +cty-Egypt-Cairo isa city; + - "Cairo"; + latitude: "29.8667"; + longitude: "31.3333"; + population: "6053000". + +cty-Eritrea-Asmara isa city; + - "Asmara"; + latitude: "15.2833"; + longitude: "38.9167". + +cty-Ethiopia-Addis-Ababa isa city; + - "Addis Ababa"; + latitude: "9"; + longitude: "38.75"; + population: "2316400". + +cty-Finland-Helsinki isa city; + - "Helsinki"; + latitude: "60.1667"; + longitude: "24.95"; + population: "487428". + +cty-France-Lyon isa city; + - "Lyon"; + latitude: "45.7"; + longitude: "4.78333"; + population: "415487". + +cty-France-Nantes isa city; + - "Nantes"; + latitude: "47.25"; + longitude: "-1.56667"; + population: "244995". + +cty-France-Nice isa city; + - "Nice"; + latitude: "43.7"; + longitude: "7.26667"; + population: "342439". + +cty-France-Paris isa city; + - "Paris"; + latitude: "48.8167"; + longitude: "2.48333"; + population: "2152423". + +cty-France-Strasbourg isa city; + - "Strasbourg"; + latitude: "48.5833"; + longitude: "7.76667"; + population: "252338". + +cty-Georgia-Macon-AP isa city; + - "Macon"; + latitude: "32.7"; + longitude: "-83.65"; + population: "107365"; + population: "113352". + +cty-Georgia-Savannah isa city; + - "Savannah"; + latitude: "32.1333"; + longitude: "-81.2"; + population: "136262"; + population: "137812". + +cty-Georgia-Tbilisi isa city; + - "Tbilisi"; + latitude: "41.7167"; + longitude: "44.8"; + population: "1200000". + +cty-Germany-Berlin isa city; + - "Berlin"; + latitude: "52.45"; + longitude: "13.3"; + population: "3472009". + +cty-Germany-Hamburg isa city; + - "Hamburg"; + latitude: "53.55"; + longitude: "9.96667"; + population: "1705872". + +cty-Germany-Hannover isa city; + - "Hannover"; + latitude: "52.4"; + longitude: "9.66667"; + population: "525763". + +cty-Germany-Mannheim isa city; + - "Mannheim"; + latitude: "49.5667"; + longitude: "8.46667"; + population: "316223". + +cty-Germany-Munich isa city; + - "Munich"; + latitude: "48.15"; + longitude: "11.5667"; + population: "1244676". + +cty-Ghana-Accra isa city; + - "Accra"; + latitude: "5.55"; + longitude: "-0.2"; + population: "867459". + +cty-Gibraltar-Gibraltar isa city; + - "Gibraltar"; + latitude: "36.15"; + longitude: "-5.36667". + +cty-Greece-Athens isa city; + - "Athens"; + latitude: "37.9667"; + longitude: "23.7167"; + population: "885737". + +cty-Greece-Thessaloniki isa city; + - "Thessaloniki"; + latitude: "40.6167"; + longitude: "22.95"; + population: "406413". + +cty-Guatemala-Guatemala-City isa city; + - "Guatemala City"; + latitude: "14.6167"; + longitude: "-90.5167"; + population: "823301". + +cty-Guyana-Georgetown isa city; + - "Georgetown"; + latitude: "6.83333"; + longitude: "-58.2"; + population: "170000". + +cty-Honduras-Tegucigalpa isa city; + - "Tegucigalpa"; + latitude: "14.1"; + longitude: "-87.2167"; + population: "670100". + +cty-Hungary-Budapest isa city; + - "Budapest"; + latitude: "47.5167"; + longitude: "19.0333"; + population: "2016000". + +cty-Iceland-Reykjavik isa city; + - "Reykjavik"; + latitude: "64.1333"; + longitude: "21.9333"; + population: "84000". + +cty-India-Bangalore isa city; + - "Bangalore"; + latitude: "12.95"; + longitude: "77.6167"; + population: "3302296". + +cty-India-Bombay isa city; + - "Bombay"; + latitude: "18.9"; + longitude: "72.8167". + +cty-India-Calcutta isa city; + - "Calcutta"; + latitude: "22.5333"; + longitude: "88.3333"; + population: "4399819". + +cty-India-Madras isa city; + - "Madras"; + latitude: "13.0667"; + longitude: "80.25"; + population: "3841396". + +cty-India-Nagpur isa city; + - "Nagpur"; + latitude: "21.15"; + longitude: "79.1167"; + population: "1624752". + +cty-India-New-Delhi isa city; + - "New Delhi"; + latitude: "28.5833"; + longitude: "77.2"; + population: "7206704". + +cty-Indonesia-Medan isa city; + - "Medan"; + latitude: "3.58333"; + longitude: "98.6833"; + population: "1730752". + +cty-Indonesia-Palembang isa city; + - "Palembang"; + latitude: "-3"; + longitude: "104.767"; + population: "1144279". + +cty-Indonesia-Surabaya isa city; + - "Surabaya"; + latitude: "-7.21667"; + longitude: "112.717"; + population: "2483871". + +cty-Iran-Tehran isa city; + - "Tehran"; + latitude: "35.6833"; + longitude: "51.4167"; + population: "6750043". + +cty-Iraq-Baghdad isa city; + - "Baghdad"; + latitude: "33.3333"; + longitude: "44.4"; + population: "4478000". + +cty-Iraq-Mosul isa city; + - "Mosul"; + latitude: "36.3167"; + longitude: "43.15"; + population: "664221". + +cty-Ireland-Dublin isa city; + - "Dublin"; + latitude: "53.3667"; + longitude: "-6.35"; + population: "502337". + +cty-Israel-Jerusalem isa city; + - "Jerusalem"; + latitude: "31.7833"; + longitude: "35.2167"; + population: "468900". + +cty-Israel-Tel-Aviv isa city; + - "Tel Aviv"; + latitude: "32.1"; + longitude: "34.7833". + +cty-Italy-Milan isa city; + - "Milan"; + latitude: "45.45"; + longitude: "9.28333"; + population: "1432184". + +cty-Italy-Rome isa city; + - "Rome"; + latitude: "41.8"; + longitude: "12.6"; + population: "2791354". + +cty-Japan-Fukuoka isa city; + - "Fukuoka"; + latitude: "33.5833"; + longitude: "130.45"; + population: "1273000". + +cty-Japan-Sapporo isa city; + - "Sapporo"; + latitude: "43.0667"; + longitude: "141.35"; + population: "1748000". + +cty-Japan-Tokyo isa city; + - "Tokyo"; + latitude: "35.6833"; + longitude: "139.767"; + population: "7843000". + +cty-Jeddah isa city; + - "Jeddah". + +cty-Jordan-Amman isa city; + - "Amman"; + latitude: "31.95"; + longitude: "35.95"; + population: "777500". + +cty-Kenya-Nairobi isa city; + - "Nairobi"; + latitude: "-1.26667"; + longitude: "36.8"; + population: "1346000"; + population: "2000000". + +cty-Lebanon-Beirut isa city; + - "Beirut"; + latitude: "33.9"; + longitude: "35.4667"; + population: "702000". + +cty-Liberia-Monrovia isa city; + - "Monrovia"; + latitude: "6.3"; + longitude: "-10.8". + +cty-Malaysia-Kuala-Lumpur isa city; + - "Kuala Lumpur"; + latitude: "3.11667"; + longitude: "101.7"; + population: "1145075". + +cty-Mexico-Guadalajara isa city; + - "Guadalajara"; + latitude: "20.6833"; + longitude: "-103.333"; + population: "1650042". + +cty-Mexico-Merida isa city; + - "Merida"; + latitude: "20.9667"; + longitude: "-89.6333"; + population: "523422". + +cty-Mexico-Mexico-City isa city; + - "Mexico City"; + latitude: "19.4"; + longitude: "-99.2"; + population: "9815795". + +cty-Mexico-Monterrey isa city; + - "Monterrey"; + latitude: "25.6667"; + longitude: "-100.3"; + population: "1068996". + +cty-Morocco-Casablanca isa city; + - "Casablanca"; + latitude: "33.5833"; + longitude: "-7.65"; + population: "2940623". + +cty-Netherlands-Amsterdam isa city; + - "Amsterdam"; + latitude: "52.3833"; + longitude: "4.91667"; + population: "1101407". + +cty-Nicaragua-Managua isa city; + - "Managua"; + latitude: "12.1667"; + longitude: "-86.25"; + population: "1195000". + +cty-Nigeria-Lagos isa city; + - "Lagos"; + latitude: "6.45"; + longitude: "3.4"; + population: "5686000". + +cty-Norway-Oslo isa city; + - "Oslo"; + latitude: "59.9333"; + longitude: "10.7333"; + population: "449337". + +cty-Pakistan-Karachi isa city; + - "Karachi"; + latitude: "24.8"; + longitude: "66.9833"; + population: "9863000". + +cty-Pakistan-Lahore isa city; + - "Lahore"; + latitude: "31.5833"; + longitude: "74.3333"; + population: "5085000". + +cty-Panama-Panama-City isa city; + - "Panama City"; + latitude: "8.96667"; + longitude: "-79.55"; + population: "594800". + +cty-Peru-Lima isa city; + - "Lima"; + latitude: "-12.0833"; + longitude: "-77.05"; + population: "6321173". + +cty-Philippines-Manila isa city; + - "Manila"; + latitude: "14.5833"; + longitude: "120.983"; + population: "1655000". + +cty-Poland-Krakow isa city; + - "Krakow"; + latitude: "50.0667"; + longitude: "19.95"; + population: "748000". + +cty-Poland-Warsaw isa city; + - "Warsaw"; + latitude: "52.2167"; + longitude: "21.0333"; + population: "1655000". + +cty-Portugal-Lisbon isa city; + - "Lisbon"; + latitude: "38.7167"; + longitude: "-9.13333"; + population: "807937". + +cty-Russia-Arkhangelsk isa city; + - "Arkhangelsk"; + latitude: "64.55"; + longitude: "40.5333"; + population: "374000". + +cty-Russia-Kaliningrad isa city; + - "Kaliningrad"; + latitude: "54.7167"; + longitude: "20.5"; + population: "419000". + +cty-Russia-Krasnoyarsk isa city; + - "Krasnoyarsk"; + latitude: "56.0167"; + longitude: "92.95"; + population: "869000". + +cty-Russia-Moscow isa city; + - "Moscow"; + latitude: "55.7667"; + longitude: "37.6667"; + population: "8717000". + +cty-Russia-Vladivostok isa city; + - "Vladivostok"; + latitude: "43.1167"; + longitude: "131.917"; + population: "632000". + +cty-Russia-Volgograd isa city; + - "Volgograd"; + latitude: "48.7"; + longitude: "44.5167"; + population: "1003000". + +cty-Senegal-Dakar isa city; + - "Dakar"; + latitude: "14.7"; + longitude: "-17.4833"; + population: "1382000". + +cty-Singapore-Singapore isa city; + - "Singapore"; + latitude: "1.3"; + longitude: "103.833"; + population: "2558000". + +cty-Spain-Barcelona isa city; + - "Barcelona"; + latitude: "41.4"; + longitude: "2.15"; + population: "1630867". + +cty-Spain-Madrid isa city; + - "Madrid"; + latitude: "40.4167"; + longitude: "-3.68333"; + population: "3041101". + +cty-Spain-Valencia isa city; + - "Valencia"; + latitude: "39.4667"; + longitude: "-0.383333"; + population: "764293". + +cty-Sudan-Khartoum isa city; + - "Khartoum"; + latitude: "15.6167"; + longitude: "32.55"; + population: "924505". + +cty-Sweden-Stockholm isa city; + - "Stockholm"; + latitude: "59.35"; + longitude: "18.0667"; + population: "711119". + +cty-Syria-Damascus isa city; + - "Damascus"; + latitude: "33.5"; + longitude: "36.3333"; + population: "1500000". + +cty-Taiwan-Tainan isa city; + - "Tainan"; + latitude: "22.95"; + longitude: "120.2"; + population: "707658". + +cty-Taiwan-Taipei isa city; + - "Taipei"; + latitude: "25.0333"; + longitude: "121.517"; + population: "2626138". + +cty-Tanzania-Dar-es-Salaam isa city; + - "Dar es Salaam"; + latitude: "-6.83333"; + longitude: "39.3"; + population: "1360850". + +cty-Thailand-Bangkok isa city; + - "Bangkok"; + latitude: "13.7333"; + longitude: "100.5"; + population: "5876000". + +cty-Tunisia-Tunis isa city; + - "Tunis"; + latitude: "36.7833"; + longitude: "10.2". + +cty-Turkey-Adana isa city; + - "Adana"; + latitude: "36.9833"; + longitude: "35.3"; + population: "1047300". + +cty-Turkey-Ankara isa city; + - "Ankara"; + latitude: "39.95"; + longitude: "32.8833"; + population: "2782200". + +cty-Turkey-Istanbul isa city; + - "Istanbul"; + latitude: "40.9667"; + longitude: "28.8333"; + population: "7615500". + +cty-Turkey-Izmir isa city; + - "Izmir"; + latitude: "38.4333"; + longitude: "27.1667"; + population: "1985300". + +cty-Ukraine-Kharkiv isa city; + - "Kharkiv"; + latitude: "50"; + longitude: "36.2333"; + population: "1618000". + +cty-Ukraine-Kiev isa city; + - "Kiev"; + latitude: "50.45"; + longitude: "30.5"; + population: "2616000". + +cty-Ukraine-Odesa isa city; + - "Odesa"; + latitude: "46.4833"; + longitude: "30.7333"; + population: "1106000". + +cty-Uruguay-Montevideo isa city; + - "Montevideo"; + latitude: "-34.85"; + longitude: "-56.2167"; + population: "1247000". + +cty-Uzbekistan-Tashkent isa city; + - "Tashkent"; + latitude: "41.3333"; + longitude: "69.3"; + population: "2106000". + +cty-Venezuela-Caracas isa city; + - "Caracas"; + latitude: "10.5"; + longitude: "-66.9333"; + population: "1822465". + +cty-Venezuela-Maracaibo isa city; + - "Maracaibo"; + latitude: "10.65"; + longitude: "-71.6"; + population: "1249670". + +cty-Vietnam-Da-Nang isa city; + - "Da Nang"; + latitude: "16.0667"; + longitude: "108.217"; + population: "369734". + +cty-Vietnam-Hanoi isa city; + - "Hanoi"; + latitude: "21.0333"; + longitude: "105.867"; + population: "3056146". + +cty-cid-cia-Albania-Tirane isa city; + - "Tirane"; + latitude: "46.2"; + longitude: "10.7"; + population: "192000". + +cty-cid-cia-Algeria-10 isa city; + - "Blida"; + population: "127284". + +cty-cid-cia-Algeria-11 isa city; + - "Bejaia"; + population: "114534". + +cty-cid-cia-Algeria-12 isa city; + - "Mostaganem"; + population: "114037". + +cty-cid-cia-Algeria-13 isa city; + - "Tlemcen"; + population: "107632". + +cty-cid-cia-Algeria-14 isa city; + - "Tebessa"; + population: "107559". + +cty-cid-cia-Algeria-15 isa city; + - "Bechar"; + population: "107311". + +cty-cid-cia-Algeria-3 isa city; + - "Oran"; + latitude: "35.4"; + longitude: "0.4"; + population: "609823". + +cty-cid-cia-Algeria-4 isa city; + - "Constantine"; + population: "440842". + +cty-cid-cia-Algeria-5 isa city; + - "Annaba"; + population: "222518". + +cty-cid-cia-Algeria-6 isa city; + - "Batna"; + population: "181601". + +cty-cid-cia-Algeria-7 isa city; + - "Setif"; + population: "170182". + +cty-cid-cia-Algeria-8 isa city; + - "Sidi bel Abbes"; + population: "152778". + +cty-cid-cia-Algeria-9 isa city; + - "Skikda"; + population: "128747". + +cty-cid-cia-American-Samoa-Pago-Pago isa city; + - "Pago Pago". + +cty-cid-cia-Andorra-Andorra-la-Vella isa city; + - "Andorra la Vella"; + latitude: "42.3"; + longitude: "1.3"; + population: "15600". + +cty-cid-cia-Angola-Benguela isa city; + - "Benguela". + +cty-cid-cia-Angola-Bie isa city; + - "Bie". + +cty-cid-cia-Angola-Cabinda isa city; + - "Cabinda". + +cty-cid-cia-Angola-Caxito isa city; + - "Caxito". + +cty-cid-cia-Angola-Huambo isa city; + - "Huambo". + +cty-cid-cia-Angola-Luanda isa city; + - "Luanda"; + latitude: "-8.6"; + longitude: "13.2". + +cty-cid-cia-Angola-Lubango isa city; + - "Lubango". + +cty-cid-cia-Angola-Lucapa isa city; + - "Lucapa". + +cty-cid-cia-Angola-Luena isa city; + - "Luena". + +cty-cid-cia-Angola-Malanje isa city; + - "Malanje". + +cty-cid-cia-Angola-Mbanza-Congo isa city; + - "Mbanza Congo". + +cty-cid-cia-Angola-Menongue isa city; + - "Menongue". + +cty-cid-cia-Angola-Namibe isa city; + - "Namibe". + +cty-cid-cia-Angola-Ndalatando isa city; + - "Ndalatando". + +cty-cid-cia-Angola-Ngiva isa city; + - "Ngiva". + +cty-cid-cia-Angola-Saurimo isa city; + - "Saurimo". + +cty-cid-cia-Angola-Sumbe isa city; + - "Sumbe". + +cty-cid-cia-Angola-Uige isa city; + - "Uige". + +cty-cid-cia-Anguilla-The-Valley isa city; + - "The Valley". + +cty-cid-cia-Antigua-and-Barbuda-Saint-Johns isa city; + - "Saint Johns"; + latitude: "17.3"; + longitude: "-61.5"; + population: "36000". + +cty-cid-cia-Argentina-10 isa city; + - "Lomas de Zamoras"; + population: "572769". + +cty-cid-cia-Argentina-11 isa city; + - "Mar del Plata"; + population: "512880". + +cty-cid-cia-Argentina-12 isa city; + - "Quilmes"; + population: "509445". + +cty-cid-cia-Argentina-13 isa city; + - "Lanus"; + population: "466755". + +cty-cid-cia-Argentina-14 isa city; + - "General San Martin"; + population: "407506". + +cty-cid-cia-Argentina-15 isa city; + - "Santa Fe"; + latitude: "-31.5"; + longitude: "-60.5"; + population: "406388". + +cty-cid-cia-Argentina-16 isa city; + - "Salta"; + latitude: "-24.5"; + longitude: "-65.3"; + population: "370904". + +cty-cid-cia-Argentina-17 isa city; + - "San Juan"; + latitude: "-31.3"; + longitude: "-68.3"; + population: "352691". + +cty-cid-cia-Argentina-18 isa city; + - "Avellaneda"; + population: "346620". + +cty-cid-cia-Argentina-19 isa city; + - "San Isidro"; + population: "299022". + +cty-cid-cia-Argentina-20 isa city; + - "Resistencia"; + latitude: "-27.3"; + longitude: "-59"; + population: "292350". + +cty-cid-cia-Argentina-21 isa city; + - "Vicente Lopez"; + population: "289142". + +cty-cid-cia-Argentina-22 isa city; + - "Santiago del Estero La Banda"; + population: "263471". + +cty-cid-cia-Argentina-23 isa city; + - "Bahia Blanca"; + population: "260096". + +cty-cid-cia-Argentina-24 isa city; + - "Corrientes"; + latitude: "-27.3"; + longitude: "-58.4"; + population: "258103". + +cty-cid-cia-Argentina-25 isa city; + - "Neuquen"; + latitude: "-39"; + longitude: "-68"; + population: "243803". + +cty-cid-cia-Argentina-26 isa city; + - "Parana"; + latitude: "-32"; + longitude: "-60"; + population: "211936". + +cty-cid-cia-Argentina-27 isa city; + - "Posadas"; + latitude: "-27.3"; + longitude: "-56"; + population: "210755". + +cty-cid-cia-Argentina-28 isa city; + - "San Salvador de Jujuy"; + latitude: "-24.1"; + longitude: "-65.2"; + population: "180102". + +cty-cid-cia-Argentina-29 isa city; + - "Formosa"; + latitude: "-26.5"; + longitude: "-58.1"; + population: "148074". + +cty-cid-cia-Argentina-30 isa city; + - "Rio Cuarto"; + population: "138853". + +cty-cid-cia-Argentina-31 isa city; + - "San Fernando"; + latitude: "-28.3"; + longitude: "-65.5"; + population: "132626". + +cty-cid-cia-Argentina-32 isa city; + - "Comodoro Rivadavia"; + population: "124104". + +cty-cid-cia-Argentina-33 isa city; + - "San Nicolas de los Arroyos"; + population: "119302". + +cty-cid-cia-Argentina-34 isa city; + - "Concordia"; + population: "116485". + +cty-cid-cia-Argentina-35 isa city; + - "San Fernando del Valle de Catamarca"; + population: "110269". + +cty-cid-cia-Argentina-36 isa city; + - "San Luis"; + latitude: "-33.2"; + longitude: "-66.2"; + population: "110136". + +cty-cid-cia-Argentina-37 isa city; + - "La Rioja"; + latitude: "-29.3"; + longitude: "-67"; + population: "103727". + +cty-cid-cia-Argentina-4 isa city; + - "Rosario"; + latitude: "-33"; + longitude: "-60.5"; + population: "1118984". + +cty-cid-cia-Argentina-5 isa city; + - "La Matanza"; + population: "1111811". + +cty-cid-cia-Argentina-6 isa city; + - "Mendoza"; + latitude: "-33"; + longitude: "-69"; + population: "773113". + +cty-cid-cia-Argentina-7 isa city; + - "La Plata"; + latitude: "-35"; + longitude: "-58"; + population: "642979". + +cty-cid-cia-Argentina-8 isa city; + - "Moron"; + population: "641541". + +cty-cid-cia-Argentina-9 isa city; + - "San Miguel de Tucuman"; + latitude: "-26.5"; + longitude: "-65.2"; + population: "622324". + +cty-cid-cia-Argentina-Rawson isa city; + - "Rawson"; + latitude: "-43.1"; + longitude: "-65"; + population: "52000". + +cty-cid-cia-Argentina-Rio-Gallegos isa city; + - "Rio Gallegos"; + latitude: "-51.4"; + longitude: "-69.2"; + population: "43000". + +cty-cid-cia-Argentina-Santa-Rosa isa city; + - "Santa Rosa"; + latitude: "-36.4"; + longitude: "-64.2"; + population: "107000". + +cty-cid-cia-Argentina-Santiago-del-Estero isa city; + - "Santiago del Estero"; + latitude: "-28"; + longitude: "-64.2"; + population: "148000". + +cty-cid-cia-Argentina-Ushuaia isa city; + - "Ushuaia"; + latitude: "-54.5"; + longitude: "-68.3"; + population: "3000". + +cty-cid-cia-Argentina-Viedma isa city; + - "Viedma"; + latitude: "-40.5"; + longitude: "-63.1"; + population: "25000". + +cty-cid-cia-Armenia-Yerevan isa city; + - "Yerevan"; + latitude: "40.1"; + longitude: "44.4"; + population: "1200000". + +cty-cid-cia-Aruba-Oranjestad isa city; + - "Oranjestad". + +cty-cid-cia-Australia-10 isa city; + - "Wollongong"; + population: "238000". + +cty-cid-cia-Australia-11 isa city; + - "Hobart"; + latitude: "-42.5"; + longitude: "147.14"; + population: "184000". + +cty-cid-cia-Australia-12 isa city; + - "Geelong"; + population: "151000". + +cty-cid-cia-Australia-13 isa city; + - "Townsville"; + population: "114000". + +cty-cid-cia-Australia-14 isa city; + - "Sunshine Coast"; + population: "110000". + +cty-cid-cia-Australia-7 isa city; + - "Newcastle"; + population: "429000". + +cty-cid-cia-Australia-8 isa city; + - "Canberra"; + latitude: "-35.1"; + longitude: "149.08"; + population: "310000". + +cty-cid-cia-Australia-9 isa city; + - "Gold Coast"; + population: "266000". + +cty-cid-cia-Australia-Bantam-Village isa city; + - "Bantam Village". + +cty-cid-cia-Australia-Flying-Fish-Cove isa city; + - "Flying Fish Cove". + +cty-cid-cia-Australia-Kingston isa city; + - "Kingston". + +cty-cid-cia-Austria-3 isa city; + - "Graz"; + latitude: "47.4"; + longitude: "15.26"; + population: "238000". + +cty-cid-cia-Austria-4 isa city; + - "Linz"; + latitude: "48.18"; + longitude: "14.18"; + population: "203000". + +cty-cid-cia-Austria-5 isa city; + - "Salzburg"; + latitude: "47.49"; + longitude: "13.2"; + population: "144000". + +cty-cid-cia-Austria-6 isa city; + - "Innsbruck"; + latitude: "47.17"; + longitude: "11.22"; + population: "118000". + +cty-cid-cia-Austria-Bregenz isa city; + - "Bregenz"; + latitude: "47.3"; + longitude: "9.45". + +cty-cid-cia-Austria-Eisenstadt isa city; + - "Eisenstadt"; + latitude: "48"; + longitude: "16"; + population: "10102". + +cty-cid-cia-Austria-Klagenfurt isa city; + - "Klagenfurt"; + latitude: "46.38"; + longitude: "14.21"; + population: "87321". + +cty-cid-cia-Austria-St-Polten isa city; + - "St. Polten"; + latitude: "48.13"; + longitude: "15.38"; + population: "51102". + +cty-cid-cia-Azerbaijan-Baku isa city; + - "Baku"; + latitude: "40.3"; + longitude: "49.5"; + population: "1740000". + +cty-cid-cia-Bahrain-Manama isa city; + - "Manama"; + latitude: "26"; + longitude: "50.5"; + population: "145000". + +cty-cid-cia-Bangladesh-10-0 isa city; + - "Tongi"; + population: "181000". + +cty-cid-cia-Bangladesh-10-2 isa city; + - "Sirajganj"; + population: "108000". + +cty-cid-cia-Bangladesh-11-0 isa city; + - "Comilla"; + population: "156000". + +cty-cid-cia-Bangladesh-11-2 isa city; + - "Narsinghdi"; + population: "106000". + +cty-cid-cia-Bangladesh-12-0 isa city; + - "Jessore"; + population: "154000". + +cty-cid-cia-Bangladesh-12-2 isa city; + - "Saidpur"; + population: "105000". + +cty-cid-cia-Bangladesh-13-0 isa city; + - "Nawabganj"; + population: "141000". + +cty-cid-cia-Bangladesh-13-2 isa city; + - "Gazipur"; + population: "104000". + +cty-cid-cia-Bangladesh-14-0 isa city; + - "Dinajpur"; + population: "138000". + +cty-cid-cia-Bangladesh-2-0 isa city; + - "Dhaka"; + latitude: "24"; + longitude: "90.5"; + population: "3839000". + +cty-cid-cia-Bangladesh-2-2 isa city; + - "Bogra"; + population: "130000". + +cty-cid-cia-Bangladesh-3-0 isa city; + - "Chittagong"; + latitude: "22.35"; + longitude: "91.8333"; + population: "1599000". + +cty-cid-cia-Bangladesh-3-2 isa city; + - "Brahmanbaria"; + population: "125000". + +cty-cid-cia-Bangladesh-4-0 isa city; + - "Khulna"; + population: "731000". + +cty-cid-cia-Bangladesh-4-2 isa city; + - "Savar"; + population: "115000". + +cty-cid-cia-Bangladesh-5-0 isa city; + - "Rajshahi"; + population: "318000". + +cty-cid-cia-Bangladesh-5-2 isa city; + - "Tangail"; + population: "114000". + +cty-cid-cia-Bangladesh-6-0 isa city; + - "Narayanganj"; + population: "296000". + +cty-cid-cia-Bangladesh-6-2 isa city; + - "Pabna"; + population: "112000". + +cty-cid-cia-Bangladesh-7-0 isa city; + - "Rangpur"; + population: "207000". + +cty-cid-cia-Bangladesh-7-2 isa city; + - "Jamalpur"; + population: "111000". + +cty-cid-cia-Bangladesh-8-0 isa city; + - "Mymensingh"; + population: "202000". + +cty-cid-cia-Bangladesh-8-2 isa city; + - "Naogaon"; + population: "110000". + +cty-cid-cia-Bangladesh-9-0 isa city; + - "Barisal"; + population: "188000". + +cty-cid-cia-Bangladesh-9-2 isa city; + - "Sylhet"; + population: "109000". + +cty-cid-cia-Barbados-Bridgetown isa city; + - "Bridgetown"; + latitude: "13.1"; + longitude: "-59.4"; + population: "10000". + +cty-cid-cia-Belgium-2-0 isa city; + - "Brussels"; + latitude: "50.8"; + longitude: "4.35"; + population: "951580". + +cty-cid-cia-Belgium-3-0 isa city; + - "Antwerp"; + latitude: "51.1"; + longitude: "4.23"; + population: "459072". + +cty-cid-cia-Belgium-4-0 isa city; + - "Ghent"; + latitude: "51.4"; + longitude: "3.5"; + population: "227483". + +cty-cid-cia-Belgium-5-0 isa city; + - "Charleroi"; + population: "206491". + +cty-cid-cia-Belgium-6-0 isa city; + - "Liege"; + latitude: "50.5"; + longitude: "5.5"; + population: "192393". + +cty-cid-cia-Belgium-7-0 isa city; + - "Bruges"; + population: "116273". + +cty-cid-cia-Belgium-8-0 isa city; + - "Namur"; + latitude: "50.3"; + longitude: "4.5"; + population: "105014". + +cty-cid-cia-Belgium-Arlon isa city; + - "Arlon"; + latitude: "49.4"; + longitude: "5.5"; + population: "23150". + +cty-cid-cia-Belgium-Brugge isa city; + - "Brugge". + +cty-cid-cia-Belgium-Hasselt isa city; + - "Hasselt"; + latitude: "50.7"; + longitude: "5.2"; + population: "65348". + +cty-cid-cia-Belgium-Mons isa city; + - "Mons"; + latitude: "50.3"; + longitude: "3.6"; + population: "90720". + +cty-cid-cia-Belize-Belmopan isa city; + - "Belmopan"; + latitude: "17.1"; + longitude: "-88.5"; + population: "3000". + +cty-cid-cia-Benin-Porto-Novo isa city; + - "Porto-Novo"; + latitude: "6.3"; + longitude: "2.4". + +cty-cid-cia-Bermuda-Hamilton isa city; + - "Hamilton". + +cty-cid-cia-Bhutan-Thimphu isa city; + - "Thimphu"; + latitude: "27"; + longitude: "90"; + population: "20000". + +cty-cid-cia-Bosnia-and-Herzegovina-Sarajevo isa city; + - "Sarajevo". + +cty-cid-cia-Botswana-Gaborone isa city; + - "Gaborone"; + latitude: "-24.5"; + longitude: "25.6". + +cty-cid-cia-Brazil-100 isa city; + - "Embu"; + population: "195676". + +cty-cid-cia-Brazil-101 isa city; + - "Petrolina"; + population: "190453". + +cty-cid-cia-Brazil-102 isa city; + - "Varzea Grande"; + population: "190374". + +cty-cid-cia-Brazil-103 isa city; + - "Juazeiro do Norte"; + population: "186490". + +cty-cid-cia-Brazil-104 isa city; + - "Itabuna"; + population: "183237". + +cty-cid-cia-Brazil-105 isa city; + - "Taboao da Serra"; + population: "182441". + +cty-cid-cia-Brazil-106 isa city; + - "Sao Leopoldo"; + population: "180741". + +cty-cid-cia-Brazil-107 isa city; + - "Suzano"; + population: "180703". + +cty-cid-cia-Brazil-108 isa city; + - "Mage"; + population: "180550". + +cty-cid-cia-Brazil-109 isa city; + - "Rio Grande"; + population: "178223". + +cty-cid-cia-Brazil-110 isa city; + - "Marilia"; + population: "177503". + +cty-cid-cia-Brazil-111 isa city; + - "Presidente Prudente"; + population: "177236". + +cty-cid-cia-Brazil-112 isa city; + - "Barueri"; + population: "176740". + +cty-cid-cia-Brazil-113 isa city; + - "Sao Carlos"; + population: "175295". + +cty-cid-cia-Brazil-114 isa city; + - "Arapiraca"; + population: "173351". + +cty-cid-cia-Brazil-115 isa city; + - "Juazeiro"; + population: "171904". + +cty-cid-cia-Brazil-116 isa city; + - "Divinopolis"; + population: "171562". + +cty-cid-cia-Brazil-117 isa city; + - "Nova Friburgo"; + population: "169218". + +cty-cid-cia-Brazil-118 isa city; + - "Jacarei"; + population: "168030". + +cty-cid-cia-Brazil-119 isa city; + - "Americana"; + population: "167901". + +cty-cid-cia-Brazil-12 isa city; + - "Manaus"; + latitude: "-3"; + longitude: "-60"; + population: "1158265". + +cty-cid-cia-Brazil-120 isa city; + - "Sumare"; + population: "167751". + +cty-cid-cia-Brazil-121 isa city; + - "Sao Jose dos Pinhais"; + population: "167286". + +cty-cid-cia-Brazil-122 isa city; + - "Sete Lagoas"; + population: "167112". + +cty-cid-cia-Brazil-123 isa city; + - "Jequie"; + population: "165361". + +cty-cid-cia-Brazil-124 isa city; + - "Barra Mansa"; + population: "164768". + +cty-cid-cia-Brazil-125 isa city; + - "Araraquara"; + population: "163831". + +cty-cid-cia-Brazil-126 isa city; + - "Aracatuba"; + population: "162546". + +cty-cid-cia-Brazil-127 isa city; + - "Santa Barbara dOeste"; + population: "161020". + +cty-cid-cia-Brazil-128 isa city; + - "Alvorada"; + population: "160671". + +cty-cid-cia-Brazil-129 isa city; + - "Maracanau"; + population: "160088". + +cty-cid-cia-Brazil-13 isa city; + - "Goiania"; + latitude: "-16.3"; + longitude: "-49.2"; + population: "998520". + +cty-cid-cia-Brazil-130 isa city; + - "Criciuma"; + population: "159033". + +cty-cid-cia-Brazil-131 isa city; + - "Itaborai"; + population: "156631". + +cty-cid-cia-Brazil-132 isa city; + - "Passo Fundo"; + population: "156352". + +cty-cid-cia-Brazil-133 isa city; + - "Nilopolis"; + population: "155190". + +cty-cid-cia-Brazil-134 isa city; + - "Boa Vista"; + latitude: "2.5"; + longitude: "-60.4"; + population: "154166". + +cty-cid-cia-Brazil-135 isa city; + - "Colombo"; + population: "153583". + +cty-cid-cia-Brazil-136 isa city; + - "Dourados"; + population: "153165". + +cty-cid-cia-Brazil-137 isa city; + - "Rio Claro"; + population: "153025". + +cty-cid-cia-Brazil-138 isa city; + - "Santa Luzia"; + population: "152682". + +cty-cid-cia-Brazil-139 isa city; + - "Praia Grande"; + population: "150574". + +cty-cid-cia-Brazil-14 isa city; + - "Guarulhos"; + population: "972766". + +cty-cid-cia-Brazil-140 isa city; + - "Guarapuava"; + population: "149158". + +cty-cid-cia-Brazil-141 isa city; + - "Sao Jose"; + population: "147490". + +cty-cid-cia-Brazil-142 isa city; + - "Cachoeiro de Itapemirim"; + population: "147283". + +cty-cid-cia-Brazil-143 isa city; + - "Maraba"; + population: "147030". + +cty-cid-cia-Brazil-144 isa city; + - "Rondonopolis"; + population: "142221". + +cty-cid-cia-Brazil-145 isa city; + - "Sao Caetano do Sul"; + population: "140808". + +cty-cid-cia-Brazil-146 isa city; + - "Lages"; + population: "140005". + +cty-cid-cia-Brazil-147 isa city; + - "Sobral"; + population: "138274". + +cty-cid-cia-Brazil-148 isa city; + - "Cabo de Santo Agostinho"; + population: "137295". + +cty-cid-cia-Brazil-149 isa city; + - "Itajai"; + population: "134797". + +cty-cid-cia-Brazil-15 isa city; + - "Campinas"; + population: "907996". + +cty-cid-cia-Brazil-150 isa city; + - "Camacari"; + population: "134768". + +cty-cid-cia-Brazil-151 isa city; + - "Itapevi"; + population: "133769". + +cty-cid-cia-Brazil-152 isa city; + - "Caxias"; + population: "133710". + +cty-cid-cia-Brazil-153 isa city; + - "Chapeco"; + population: "130458". + +cty-cid-cia-Brazil-154 isa city; + - "Teofilo Otoni"; + population: "127214". + +cty-cid-cia-Brazil-155 isa city; + - "Cotia"; + population: "127047". + +cty-cid-cia-Brazil-156 isa city; + - "Parnaiba"; + population: "124641". + +cty-cid-cia-Brazil-157 isa city; + - "Alagoinhas"; + population: "122882". + +cty-cid-cia-Brazil-158 isa city; + - "Teresopolis"; + population: "122614". + +cty-cid-cia-Brazil-159 isa city; + - "Itu"; + population: "122544". + +cty-cid-cia-Brazil-16 isa city; + - "Sao Goncalo"; + population: "827967". + +cty-cid-cia-Brazil-160 isa city; + - "Indaiatuba"; + population: "122159". + +cty-cid-cia-Brazil-161 isa city; + - "Ferraz de Vasconcelos"; + population: "121992". + +cty-cid-cia-Brazil-162 isa city; + - "Pocos de Caldas"; + population: "121845". + +cty-cid-cia-Brazil-163 isa city; + - "Uruguaiana"; + population: "121825". + +cty-cid-cia-Brazil-164 isa city; + - "Timon"; + population: "118332". + +cty-cid-cia-Brazil-165 isa city; + - "Castanhal"; + population: "117747". + +cty-cid-cia-Brazil-166 isa city; + - "Paranagua"; + population: "115394". + +cty-cid-cia-Brazil-167 isa city; + - "Hortolandia"; + population: "114885". + +cty-cid-cia-Brazil-168 isa city; + - "Moji Guacu"; + population: "114555". + +cty-cid-cia-Brazil-169 isa city; + - "Pindamonhangaba"; + population: "114092". + +cty-cid-cia-Brazil-17 isa city; + - "Novo Iguacu"; + population: "801036". + +cty-cid-cia-Brazil-170 isa city; + - "Bage"; + population: "114091". + +cty-cid-cia-Brazil-171 isa city; + - "Sapucaia do Sul"; + population: "113992". + +cty-cid-cia-Brazil-172 isa city; + - "Barreiras"; + population: "113544". + +cty-cid-cia-Brazil-173 isa city; + - "Macae"; + population: "112966". + +cty-cid-cia-Brazil-174 isa city; + - "Patos de Minas"; + population: "112690". + +cty-cid-cia-Brazil-175 isa city; + - "Itapetininga"; + population: "111909". + +cty-cid-cia-Brazil-176 isa city; + - "Vitoria de Santo Antao"; + population: "111575". + +cty-cid-cia-Brazil-177 isa city; + - "Camaragibe"; + population: "111190". + +cty-cid-cia-Brazil-178 isa city; + - "Itapecerica da Serra"; + population: "110362". + +cty-cid-cia-Brazil-179 isa city; + - "Garanhuns"; + population: "110190". + +cty-cid-cia-Brazil-18 isa city; + - "Sao Luis"; + latitude: "-2.3"; + longitude: "-44.1"; + population: "781068". + +cty-cid-cia-Brazil-180 isa city; + - "Braganca Paulista"; + population: "109863". + +cty-cid-cia-Brazil-181 isa city; + - "Queimados"; + population: "108531". + +cty-cid-cia-Brazil-182 isa city; + - "Barbacena"; + population: "107843". + +cty-cid-cia-Brazil-183 isa city; + - "Ibirite"; + population: "106773". + +cty-cid-cia-Brazil-184 isa city; + - "Abaetetuba"; + population: "106753". + +cty-cid-cia-Brazil-185 isa city; + - "Francisco Morato"; + population: "106328". + +cty-cid-cia-Brazil-186 isa city; + - "Santa Rita"; + population: "105584". + +cty-cid-cia-Brazil-187 isa city; + - "Araguaina"; + population: "105000". + +cty-cid-cia-Brazil-188 isa city; + - "Itaituba"; + population: "104896". + +cty-cid-cia-Brazil-189 isa city; + - "Luziania"; + population: "104840". + +cty-cid-cia-Brazil-19 isa city; + - "Maceio"; + latitude: "-9.3"; + longitude: "-35.5"; + population: "723156". + +cty-cid-cia-Brazil-190 isa city; + - "Codo"; + population: "104825". + +cty-cid-cia-Brazil-191 isa city; + - "Barretos"; + population: "104782". + +cty-cid-cia-Brazil-192 isa city; + - "Colatina"; + population: "103621". + +cty-cid-cia-Brazil-193 isa city; + - "Jau"; + population: "103605". + +cty-cid-cia-Brazil-194 isa city; + - "Nossa Senhora do Socorro"; + population: "103496". + +cty-cid-cia-Brazil-195 isa city; + - "Linhares"; + population: "103030". + +cty-cid-cia-Brazil-196 isa city; + - "Cabo Frio"; + population: "101142". + +cty-cid-cia-Brazil-197 isa city; + - "Apucarana"; + population: "101005". + +cty-cid-cia-Brazil-198 isa city; + - "Catanduva"; + population: "100913". + +cty-cid-cia-Brazil-199 isa city; + - "Botucatu"; + population: "100826". + +cty-cid-cia-Brazil-20 isa city; + - "Duque de Caxias"; + population: "712370". + +cty-cid-cia-Brazil-200 isa city; + - "Sabara"; + population: "100570". + +cty-cid-cia-Brazil-201 isa city; + - "Santa Cruz do Sul"; + population: "100562". + +cty-cid-cia-Brazil-202 isa city; + - "Ribeirao Pires"; + population: "100335". + +cty-cid-cia-Brazil-203 isa city; + - "Rio Verde"; + population: "100223". + +cty-cid-cia-Brazil-204 isa city; + - "Varginha"; + population: "100079". + +cty-cid-cia-Brazil-21 isa city; + - "Sao Bernardo do Campo"; + population: "658791". + +cty-cid-cia-Brazil-22 isa city; + - "Natal"; + latitude: "-5.5"; + longitude: "-35.1"; + population: "656244". + +cty-cid-cia-Brazil-23 isa city; + - "Teresina"; + latitude: "-5"; + longitude: "-42.5"; + population: "653994". + +cty-cid-cia-Brazil-24 isa city; + - "Santo Andre"; + population: "625294". + +cty-cid-cia-Brazil-25 isa city; + - "Osasco"; + population: "622374". + +cty-cid-cia-Brazil-26 isa city; + - "Campo Grande"; + population: "598216". + +cty-cid-cia-Brazil-27 isa city; + - "Joao Pessoa"; + latitude: "-7.1"; + longitude: "-35"; + population: "549270". + +cty-cid-cia-Brazil-28 isa city; + - "Jaboatao dos Guararapes"; + population: "528973". + +cty-cid-cia-Brazil-29 isa city; + - "Contagem"; + population: "491268". + +cty-cid-cia-Brazil-3 isa city; + - "Rio de Janeiro"; + latitude: "-23"; + longitude: "-43.2"; + population: "5533011". + +cty-cid-cia-Brazil-30 isa city; + - "Sao Jose dos Campos"; + population: "485780". + +cty-cid-cia-Brazil-31 isa city; + - "Ribeirao Preto"; + population: "452804". + +cty-cid-cia-Brazil-32 isa city; + - "Niteroi"; + population: "450129". + +cty-cid-cia-Brazil-33 isa city; + - "Feira de Santana"; + population: "449960". + +cty-cid-cia-Brazil-34 isa city; + - "Uberlandia"; + population: "437111". + +cty-cid-cia-Brazil-35 isa city; + - "Sao Joao de Meriti"; + population: "433713". + +cty-cid-cia-Brazil-36 isa city; + - "Cuiaba"; + latitude: "-15.3"; + longitude: "-56"; + population: "433101". + +cty-cid-cia-Brazil-37 isa city; + - "Sorocaba"; + population: "431370". + +cty-cid-cia-Brazil-38 isa city; + - "Aracaju"; + latitude: "-11"; + longitude: "-37.1"; + population: "426580". + +cty-cid-cia-Brazil-39 isa city; + - "Juiz de Fora"; + population: "423913". + +cty-cid-cia-Brazil-40 isa city; + - "Londrina"; + population: "412894". + +cty-cid-cia-Brazil-41 isa city; + - "Santos"; + population: "412288". + +cty-cid-cia-Brazil-42 isa city; + - "Joinvile"; + population: "397987". + +cty-cid-cia-Brazil-43 isa city; + - "Belfort Roxo"; + population: "393520". + +cty-cid-cia-Brazil-44 isa city; + - "Campos dos Goytacazes"; + population: "391299". + +cty-cid-cia-Brazil-45 isa city; + - "Olinda"; + population: "355741". + +cty-cid-cia-Brazil-46 isa city; + - "Maua"; + population: "344684". + +cty-cid-cia-Brazil-47 isa city; + - "Ananindeua"; + population: "342905". + +cty-cid-cia-Brazil-48 isa city; + - "Campina Grande"; + population: "340412". + +cty-cid-cia-Brazil-49 isa city; + - "Carapicuiba"; + population: "328015". + +cty-cid-cia-Brazil-50 isa city; + - "Caxias do Sul"; + population: "326222". + +cty-cid-cia-Brazil-51 isa city; + - "Sao Jose do Rio Preto"; + population: "323418". + +cty-cid-cia-Brazil-52 isa city; + - "Diadema"; + population: "323221". + +cty-cid-cia-Brazil-53 isa city; + - "Moji das Cruzes"; + population: "314947". + +cty-cid-cia-Brazil-54 isa city; + - "Pelotas"; + population: "304285". + +cty-cid-cia-Brazil-55 isa city; + - "Piracicaba"; + population: "302605". + +cty-cid-cia-Brazil-56 isa city; + - "Cariacica"; + population: "300085". + +cty-cid-cia-Brazil-57 isa city; + - "Vila Velha"; + population: "297052". + +cty-cid-cia-Brazil-58 isa city; + - "Porto Velho"; + latitude: "-8.5"; + longitude: "-63.5"; + population: "293815". + +cty-cid-cia-Brazil-59 isa city; + - "Jundiai"; + population: "293237". + +cty-cid-cia-Brazil-60 isa city; + - "Bauru"; + population: "293026". + +cty-cid-cia-Brazil-61 isa city; + - "Canoas"; + population: "284114". + +cty-cid-cia-Brazil-62 isa city; + - "Sao Vicente"; + population: "279620". + +cty-cid-cia-Brazil-63 isa city; + - "Montes Claros"; + population: "271324". + +cty-cid-cia-Brazil-64 isa city; + - "Florianopolis"; + latitude: "-27.3"; + longitude: "-58.3"; + population: "268551". + +cty-cid-cia-Brazil-65 isa city; + - "Maringa"; + population: "267878". + +cty-cid-cia-Brazil-66 isa city; + - "Petropolis"; + population: "267604". + +cty-cid-cia-Brazil-67 isa city; + - "Franca"; + population: "266909". + +cty-cid-cia-Brazil-68 isa city; + - "Serra"; + population: "266851". + +cty-cid-cia-Brazil-69 isa city; + - "Aparecida de Goiania"; + population: "265446". + +cty-cid-cia-Brazil-70 isa city; + - "Anapolis"; + population: "264873". + +cty-cid-cia-Brazil-71 isa city; + - "Vitoria"; + latitude: "-20.2"; + longitude: "-40.3"; + population: "263708". + +cty-cid-cia-Brazil-72 isa city; + - "Ponta Grossa"; + population: "252674". + +cty-cid-cia-Brazil-73 isa city; + - "Betim"; + population: "249795". + +cty-cid-cia-Brazil-74 isa city; + - "Santarem"; + population: "242765". + +cty-cid-cia-Brazil-75 isa city; + - "Ilheus"; + population: "242589". + +cty-cid-cia-Brazil-76 isa city; + - "Vitoria da Conquista"; + population: "241776". + +cty-cid-cia-Brazil-77 isa city; + - "Paulista"; + population: "234706". + +cty-cid-cia-Brazil-78 isa city; + - "Uberaba"; + population: "232134". + +cty-cid-cia-Brazil-79 isa city; + - "Caruaru"; + population: "231874". + +cty-cid-cia-Brazil-80 isa city; + - "Foz do Iguacu"; + population: "231596". + +cty-cid-cia-Brazil-81 isa city; + - "Governador Valadares"; + population: "231077". + +cty-cid-cia-Brazil-82 isa city; + - "Blumenau"; + population: "230988". + +cty-cid-cia-Brazil-83 isa city; + - "Limeira"; + population: "230292". + +cty-cid-cia-Brazil-84 isa city; + - "Volta Redonda"; + population: "228939". + +cty-cid-cia-Brazil-85 isa city; + - "Rio Branco"; + latitude: "-9.5"; + longitude: "-67.5"; + population: "228907". + +cty-cid-cia-Brazil-86 isa city; + - "Itaquaquecetuba"; + population: "228533". + +cty-cid-cia-Brazil-87 isa city; + - "Imperatriz"; + population: "227731". + +cty-cid-cia-Brazil-88 isa city; + - "Santa Maria"; + population: "226226". + +cty-cid-cia-Brazil-89 isa city; + - "Guaruja"; + population: "226185". + +cty-cid-cia-Brazil-90 isa city; + - "Novo Hamburgo"; + population: "225082". + +cty-cid-cia-Brazil-91 isa city; + - "Taubate"; + population: "220179". + +cty-cid-cia-Brazil-92 isa city; + - "Cascavel"; + population: "219623". + +cty-cid-cia-Brazil-93 isa city; + - "Macapa"; + latitude: "0.5"; + longitude: "-52"; + population: "214197". + +cty-cid-cia-Brazil-94 isa city; + - "Caucaia"; + population: "208902". + +cty-cid-cia-Brazil-95 isa city; + - "Mossoro"; + population: "205732". + +cty-cid-cia-Brazil-96 isa city; + - "Gravatai"; + population: "205657". + +cty-cid-cia-Brazil-97 isa city; + - "Ribeirao das Neves"; + population: "197147". + +cty-cid-cia-Brazil-98 isa city; + - "Viamao"; + population: "195880". + +cty-cid-cia-Brazil-99 isa city; + - "Ipatinga"; + population: "195736". + +cty-cid-cia-Brazil-Palmas isa city; + - "Palmas". + +cty-cid-cia-British-Virgin-Islands-Road-Town isa city; + - "Road Town". + +cty-cid-cia-Brunei-Bandar-Seri-Begawan isa city; + - "Bandar Seri Begawan"; + latitude: "5"; + longitude: "115"; + population: "56300". + +cty-cid-cia-Burkina-Faso-Ouagadougou isa city; + - "Ouagadougou"; + latitude: "12"; + longitude: "-2". + +cty-cid-cia-Burma-4 isa city; + - "Moulmein"; + population: "220000". + +cty-cid-cia-Burma-5 isa city; + - "Bago"; + population: "150500". + +cty-cid-cia-Burma-6 isa city; + - "Pathein"; + population: "144100". + +cty-cid-cia-Burma-7 isa city; + - "Taunggyi"; + population: "108200". + +cty-cid-cia-Burma-8 isa city; + - "Akyab"; + population: "107600". + +cty-cid-cia-Burma-9 isa city; + - "Monywa"; + population: "106800". + +cty-cid-cia-Burma-Hakha isa city; + - "Hakha". + +cty-cid-cia-Burma-Hpa-an isa city; + - "Hpa an". + +cty-cid-cia-Burma-Loikaw isa city; + - "Loikaw". + +cty-cid-cia-Burma-Magway isa city; + - "Magway". + +cty-cid-cia-Burma-Myitkyina isa city; + - "Myitkyina". + +cty-cid-cia-Burma-Sagaing isa city; + - "Sagaing". + +cty-cid-cia-Burma-Tavoy isa city; + - "Tavoy". + +cty-cid-cia-Burundi-Bujumbura isa city; + - "Bujumbura"; + latitude: "-4"; + longitude: "29". + +cty-cid-cia-Cameroon-2 isa city; + - "Douala"; + latitude: "3.5"; + longitude: "10"; + population: "884000". + +cty-cid-cia-Cameroon-3 isa city; + - "Yaounde"; + latitude: "3.5"; + longitude: "12"; + population: "750000". + +cty-cid-cia-Cameroon-4 isa city; + - "Garoua"; + population: "177000". + +cty-cid-cia-Cameroon-5 isa city; + - "Maroua"; + population: "143000". + +cty-cid-cia-Cameroon-6 isa city; + - "Bamenda"; + population: "138000". + +cty-cid-cia-Cameroon-7 isa city; + - "Bafoussam"; + population: "131000". + +cty-cid-cia-Cameroon-Bertoua isa city; + - "Bertoua". + +cty-cid-cia-Cameroon-Buea isa city; + - "Buea". + +cty-cid-cia-Cameroon-Ebolowa isa city; + - "Ebolowa". + +cty-cid-cia-Cameroon-Ngaoundere isa city; + - "Ngaoundere". + +cty-cid-cia-Canada-10 isa city; + - "Mississauga"; + population: "463388". + +cty-cid-cia-Canada-11 isa city; + - "Hamilton"; + latitude: "43.2667"; + longitude: "-79.9"; + population: "318499". + +cty-cid-cia-Canada-12 isa city; + - "Laval"; + population: "314398". + +cty-cid-cia-Canada-13 isa city; + - "Ottawa"; + latitude: "45.3"; + longitude: "-75.5"; + population: "313987". + +cty-cid-cia-Canada-14 isa city; + - "Etobicoke"; + population: "309993". + +cty-cid-cia-Canada-15 isa city; + - "London"; + latitude: "43.0333"; + longitude: "-81.15"; + population: "303165". + +cty-cid-cia-Canada-16 isa city; + - "Surrey"; + population: "245173". + +cty-cid-cia-Canada-17 isa city; + - "Brampton"; + population: "234445". + +cty-cid-cia-Canada-18 isa city; + - "Windsor"; + latitude: "42.2667"; + longitude: "-82.9667"; + population: "191435". + +cty-cid-cia-Canada-19 isa city; + - "Saskatoon"; + latitude: "52"; + longitude: "-107"; + population: "186058". + +cty-cid-cia-Canada-2 isa city; + - "Montreal"; + latitude: "45.3"; + longitude: "-73.5"; + population: "1017666". + +cty-cid-cia-Canada-20 isa city; + - "Regina"; + latitude: "50.4333"; + longitude: "-104.667"; + population: "179178". + +cty-cid-cia-Canada-21 isa city; + - "Kitchener"; + latitude: "43.4333"; + longitude: "-80.5"; + population: "168282". + +cty-cid-cia-Canada-22 isa city; + - "Quebec"; + latitude: "46.8"; + longitude: "-71.3833"; + population: "167517". + +cty-cid-cia-Canada-23 isa city; + - "Burnaby"; + population: "158858". + +cty-cid-cia-Canada-24 isa city; + - "Markham"; + population: "153811". + +cty-cid-cia-Canada-25 isa city; + - "York"; + population: "140525". + +cty-cid-cia-Canada-26 isa city; + - "Longueuil"; + population: "129874". + +cty-cid-cia-Canada-27 isa city; + - "Burlington"; + population: "129575". + +cty-cid-cia-Canada-28 isa city; + - "Oshawa"; + latitude: "43.9"; + longitude: "-78.8667"; + population: "129344". + +cty-cid-cia-Canada-29 isa city; + - "Saint Catharines"; + population: "129300". + +cty-cid-cia-Canada-3 isa city; + - "Calgary"; + latitude: "51.1"; + longitude: "-114.017"; + population: "710677". + +cty-cid-cia-Canada-30 isa city; + - "Richmond"; + population: "126624". + +cty-cid-cia-Canada-31 isa city; + - "Halifax"; + latitude: "44.4"; + longitude: "-63.4"; + population: "114455". + +cty-cid-cia-Canada-32 isa city; + - "Thunder Bay"; + latitude: "48.3667"; + longitude: "-89.3167"; + population: "113746". + +cty-cid-cia-Canada-33 isa city; + - "Vaughan"; + population: "111359". + +cty-cid-cia-Canada-34 isa city; + - "Nepean"; + population: "107627". + +cty-cid-cia-Canada-35 isa city; + - "East York"; + population: "102696". + +cty-cid-cia-Canada-36 isa city; + - "Glouchester"; + population: "101677". + +cty-cid-cia-Canada-4 isa city; + - "Toronto"; + latitude: "43.5"; + longitude: "-79.5"; + population: "635395". + +cty-cid-cia-Canada-5 isa city; + - "Winnipeg"; + latitude: "49.5"; + longitude: "-97.1"; + population: "616790". + +cty-cid-cia-Canada-6 isa city; + - "Edmonton"; + latitude: "53.5667"; + longitude: "-113.517"; + population: "616741". + +cty-cid-cia-Canada-7 isa city; + - "No... [truncated message content] |
From: <lh...@us...> - 2009-03-09 13:57:43
|
Revision: 282 http://tinytim.svn.sourceforge.net/tinytim/?rev=282&view=rev Author: lheuer Date: 2009-03-09 13:57:29 +0000 (Mon, 09 Mar 2009) Log Message: ----------- - Removed default "xsd" prefix - Added support for user defined prefixes - Added support for item identifier suppression - Topics are now grouped by their type - Java docs Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-03-08 14:46:50 UTC (rev 281) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-03-09 13:57:29 UTC (rev 282) @@ -37,7 +37,6 @@ import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.IScoped; import org.tinytim.internal.api.IVariant; -import org.tinytim.voc.Namespace; import org.tinytim.voc.TMDM; import org.tinytim.voc.XSD; @@ -53,6 +52,7 @@ import org.tmapi.core.TopicMap; import org.tmapi.core.Typed; import org.tmapi.core.Variant; +import org.tmapi.index.ScopedIndex; import org.tmapi.index.TypeInstanceIndex; /** @@ -68,38 +68,76 @@ private static final Logger LOG = Logger.getLogger(CTMTopicMapWriter.class.getName()); + //TODO: Unicode ranges in patterns private static final Pattern _ID_PATTERN = Pattern.compile("[A-Za-z_](\\.*[\\-A-Za-z_0-9])*"); + private static final Pattern _LOCAL_PATTERN = Pattern.compile("([0-9]*\\.*[\\-A-Za-z_0-9])*"); + private static final char[] _TRIPLE_QUOTES = new char[] { '"', '"', '"' }; + private static final Reference[] _EMPTY_REFERENCE_ARRAY = new Reference[0]; + private static final Reference _UNTYPED_REFERENCE = Reference.createId("[untyped]"); + private final Writer _out; private final String _baseIRI; private final String _encoding; private Topic _defaultNameType; - //TODO: Add setters/getters - private boolean _exportIIDs = true; - private boolean _prettify = true; + private boolean _exportIIDs; + private boolean _keepAbsoluteIIDs; private String _title; private String _author; private String _license; private String _comment; + private char[] _indent; private final Comparator<Topic> _topicComparator; + private final Comparator<Topic> _topicIdComparator; private final Comparator<Association> _assocComparator; private final Comparator<Occurrence> _occComparator; private final Comparator<Name> _nameComparator; private final Comparator<Set<Topic>> _scopeComparator; - private final Comparator<Locator> _locComparator; - private final Comparator<Set<Locator>> _locSetComparator; private final Comparator<Role> _roleComparator; private final Comparator<Variant> _variantComparator; - private final Map<Topic, TopicReference> _topic2Reference; + private final Map<Topic, Reference> _topic2Reference; //TODO: LRU? + private final Map<String, String> _prefixes; + private Reference _lastReference; - + /** + * Constructs a new instance using "utf-8" encoding. + * <p> + * The base IRI is used to abbreviate IRIs. IRIs with a fragment identifier + * (like <tt>#my-topic</tt>) are written in an abbreviated from iff they + * start with the provided base IRI. + * </p> + * + * @param out The stream to write onto. + * @param baseIRI The base IRI to resolve locators against. + * @throws IOException In case of an error. + */ public CTMTopicMapWriter(final OutputStream out, final String baseIRI) throws IOException { this(out, baseIRI, "utf-8"); } + /** + * Constructs a new instance with the specified encoding. + * <p> + * The base IRI is used to abbreviate IRIs. IRIs with a fragment identifier + * (like <tt>#my-topic</tt>) are written in an abbreviated from iff they + * start with the provided base IRI. + * </p> + * + * @param out The stream to write onto. + * @param baseIRI The base IRI to resolve locators against. + * @param encoding The encoding to use. + * @throws IOException In case of an error, i.e. if the encoding is unsupported. + */ public CTMTopicMapWriter(final OutputStream out, final String baseIRI, final String encoding) throws IOException { this(new OutputStreamWriter(out, encoding), baseIRI, encoding); } + /** + * Constructs a new instance. + * + * @param writer The writer to use. + * @param baseIRI The base IRI to resolve locators against. + * @param encoding The encoding to use. + */ private CTMTopicMapWriter(final Writer writer, final String baseIRI, final String encoding) { _out = writer; if (baseIRI == null) { @@ -110,20 +148,23 @@ throw new IllegalArgumentException("The encoding must not be null"); } _encoding = encoding; - _topic2Reference = new HashMap<Topic, TopicReference>(200); + _topic2Reference = new HashMap<Topic, Reference>(200); + _topicComparator = new TopicComparator(); _scopeComparator = new ScopeComparator(); - _locSetComparator = new LocatorSetComparator(); - _locComparator = new LocatorComparator(); - _topicComparator = new TopicComparator(); + _topicIdComparator = new TopicIdComparator(); _assocComparator = new AssociationComparator(); _occComparator = new OccurrenceComparator(); _nameComparator = new NameComparator(); _roleComparator = new RoleComparator(); _variantComparator = new VariantComparator(); + _prefixes = new HashMap<String, String>(); + setIdentation(4); + setExportItemIdentifiers(false); } /** - * Sets the title of the topic map which appears at the top of the file. + * Sets the title of the topic map which appears in the header comment of + * the file. * * @param title The title of the topic map. */ @@ -141,7 +182,7 @@ } /** - * Sets the author which appears at the top of the file. + * Sets the author which appears in the header comment of the file. * * @param author The author. */ @@ -159,7 +200,7 @@ } /** - * Sets the license which should appear on top of the file. + * Sets the license which should appear in the header comment of the file. * <p> * The license of the topic map. This could be a name or an IRI or both, i.e. * "Creative Commons-License <http://creativecommons.org/licenses/by-nc-sa/3.0/>". @@ -181,7 +222,7 @@ } /** - * Sets a file comment. + * The an additional comment which appears in the header comment of the file. * <p> * The comment could describe the topic map, or provide an additional * copyright notice, or SVN/CVS keywords etc. @@ -202,6 +243,105 @@ return _comment; } + /** + * Adds a prefix to the writer. + * <p> + * The writer converts all locators (item identifiers, subject identifiers, + * subject locators) into QNames which start with the provided + * <tt>reference</tt>. + * </p> + * <p> + * I.e. if a prefix "wp" is set to "http://en.wikipedia.org/wiki", a + * subject identifier like "http://en.wikipedia.org/wiki/John_Lennon" is + * converted into a QName "wp:John_Lennon". + * </p> + * + * @param prefix The prefix to add, an existing prefix with the same name + * will be overridden. + * @param reference The IRI to which the prefix should be assigned to. + */ + public void addPrefix(String prefix, String reference) { + _prefixes.put(prefix, reference); + } + + /** + * Removes a prefix mapping. + * + * @param prefix The prefix to remove. + */ + public void removePrefix(String prefix) { + _prefixes.remove(prefix); + } + + /** + * Sets the identation level, by default the identation level is set to 4 + * which means four whitespace characters are written. + * <p> + * If the size is set to <tt>0</tt>, no identation will be done. + * </p> + * <p> + * The identation level indicates how many whitespaces are written in front + * of a statement within a topic block. + * </p> + * <p>Example (identation level = 4): + * <pre> + * john isa person; + * - "John". + * </pre> + * </p> + * <p>Example (identation level = 0): + * <pre> + * paul isa person; + * - "Paul". + * </pre> + * </p> + * + * @param level The identation level. + */ + public void setIdentation(int level) { + if (_indent == null || _indent.length != level) { + _indent = new char[level]; + Arrays.fill(_indent, ' '); + } + } + + /** + * Returns the identation level. + * + * @return The number of whitespaces which are written in front of a + * statement within a topic block. + */ + public int getIdentation() { + return _indent.length; + } + + /** + * Indicates if the item identifiers of the topics should be exported. + * <p> + * By default, this feature is disabled. + * </p> + * + * @param export <tt>true</tt> to export item identifiers, otherwise <tt>false</tt>. + */ + public void setExportItemIdentifiers(boolean export) { + setExportItemIdentifiers(export, export); + } + + /** + * Indicates if the item identifiers of a topic are exported. + * + * @return <tt>true</tt> if the item identifiers are exported, otherwise <tt>false</tt>. + */ + public boolean getExportItemIdentifiers() { + return _exportIIDs; + } + + // Unsure if this feature should be exposed, keep it private currently + private void setExportItemIdentifiers(boolean export, boolean keepAbsoluteItemIdentifiers) { + _exportIIDs = export; + _keepAbsoluteIIDs = keepAbsoluteItemIdentifiers; + } + /* (non-Javadoc) * @see org.tinytim.mio.TopicMapWriter#write(org.tmapi.core.TopicMap) */ @@ -212,13 +352,9 @@ _newline(); _out.write("%version 1.0"); _writeFileHeader(); - _out.write("%prefix xsd <" + Namespace.XSD + "> # Default prefix"); + _writePrefixes(); _newline(); Collection<Topic> topics = new ArrayList<Topic>(topicMap.getTopics()); - final boolean removeDefaultNameType = _shouldStandardTopicExported(_defaultNameType); - if (removeDefaultNameType) { - topics.remove(_defaultNameType); - } if (topicMap.getReifier() != null) { // Special handling of the tm reifier to avoid an additional // whitespace character in front of the ~ @@ -227,7 +363,7 @@ _out.write("~ "); _writeTopicRef(reifier); _newline(); - _writeTopic(reifier); + _writeTopic(reifier, false); topics.remove(reifier); } TypeInstanceIndex tiIdx = ((IIndexManagerAware) topicMap).getIndexManager().getTypeInstanceIndex(); @@ -235,16 +371,43 @@ tiIdx.reindex(); } _writeSection("ONTOLOGY"); - _writeOntologyTypes(tiIdx.getTopicTypes(), topics, "Topic Types"); - _writeOntologyTypes(tiIdx.getAssociationTypes(), topics, "Association Types"); - _writeOntologyTypes(tiIdx.getRoleTypes(), topics, "Role Types"); - _writeOntologyTypes(tiIdx.getOccurrenceTypes(), topics, "Occurrence Types"); - Collection<Topic> nameTypes = new ArrayList<Topic>(tiIdx.getNameTypes()); - if (removeDefaultNameType) { - nameTypes.remove(_defaultNameType); + _writeOntologySection(tiIdx.getTopicTypes(), topics, "Topic Types"); + Collection<Topic> types = tiIdx.getAssociationTypes(); + final Topic typeInstance = topicMap.getTopicBySubjectIdentifier(TMDM.TYPE_INSTANCE); + if (_omitTopic(typeInstance)) { + types.remove(typeInstance); + topics.remove(typeInstance); } - _writeOntologyTypes(nameTypes, topics, "Name Types"); + _writeOntologySection(types, topics, "Association Types"); + types = tiIdx.getRoleTypes(); + final Topic type = topicMap.getTopicBySubjectIdentifier(TMDM.TYPE); + final Topic instance = topicMap.getTopicBySubjectIdentifier(TMDM.INSTANCE); + if (_omitTopic(type)) { + types.remove(type); + topics.remove(type); + } + if (_omitTopic(instance)) { + types.remove(instance); + topics.remove(instance); + } + _writeOntologySection(types, topics, "Role Types"); + _writeOntologySection(tiIdx.getOccurrenceTypes(), topics, "Occurrence Types"); + types = new ArrayList<Topic>(tiIdx.getNameTypes()); + if (_omitTopic(_defaultNameType)) { + types.remove(_defaultNameType); + topics.remove(_defaultNameType); + } + _writeOntologySection(types, topics, "Name Types"); tiIdx.close(); + ScopedIndex scopeIdx = ((IIndexManagerAware) topicMap).getIndexManager().getScopedIndex(); + if (!scopeIdx.isAutoUpdated()) { + scopeIdx.reindex(); + } + _writeOntologySection(scopeIdx.getAssociationThemes(), topics, "Association Themes"); + _writeOntologySection(scopeIdx.getOccurrenceThemes(), topics, "Occurrence Themes"); + _writeOntologySection(scopeIdx.getNameThemes(), topics, "Name Themes"); + _writeOntologySection(scopeIdx.getVariantThemes(), topics, "Variant Themes"); + scopeIdx.close(); _newline(); _writeSection("INSTANCES"); _writeSection("Topics"); @@ -265,14 +428,22 @@ _topic2Reference.clear(); } - private boolean _shouldStandardTopicExported(Topic topic) { + /** + * Indicates if the provided <tt>topic</tt> has just one subject identifier + * and provides no further properties. + * + * @param topic The topic to check. + * @return <tt>true</tt> if the topic should be omitted, otherwise <tt>false</tt>. + */ + private boolean _omitTopic(Topic topic) { return topic != null && topic.getSubjectIdentifiers().size() == 1 - && topic.getSubjectLocators().size() == 0 - && topic.getTypes().size() == 0 - && topic.getNames().size() == 0 - && topic.getOccurrences().size() == 0 - && topic.getRolesPlayed().size() == 0 + && topic.getSubjectLocators().isEmpty() + && (!_exportIIDs || topic.getItemIdentifiers().isEmpty()) + && topic.getTypes().isEmpty() + && topic.getNames().isEmpty() + && topic.getOccurrences().isEmpty() + && topic.getRolesPlayed().isEmpty() && topic.getReified() == null; } @@ -309,11 +480,27 @@ _newline(); _newline(); _out.write(")#"); - _newline(); - _newline(); } /** + * Writes the registered prefixes. + * + * @throws IOException In case of an error. + */ + private void _writePrefixes() throws IOException { + if (_prefixes.isEmpty()) { + return; + } + _writeSection("Prefixes"); + String[] keys = _prefixes.keySet().toArray(new String[0]); + Arrays.sort(keys); + for (String ident: keys) { + _out.write("%prefix " + ident + " <" + _prefixes.get(ident) + ">"); + _newline(); + } + } + + /** * If <tt>topics</tt> is not empty, the topics will be removed from * <tt>allTopics</tt> and written out under the specified section <tt>title</tt>. * @@ -322,7 +509,7 @@ * @param title The title of the ontology section. * @throws IOException In case of an error. */ - private void _writeOntologyTypes(Collection<Topic> topics, Collection<Topic> allTopics, String title) throws IOException { + private void _writeOntologySection(Collection<Topic> topics, Collection<Topic> allTopics, String title) throws IOException { if (topics.isEmpty()) { return; } @@ -338,10 +525,11 @@ * @throws IOException In case of an error. */ private void _writeTopics(Collection<Topic> topics) throws IOException { + _lastReference = null; Topic[] topicArray = topics.toArray(new Topic[topics.size()]); Arrays.sort(topicArray, _topicComparator); for (Topic topic: topicArray) { - _writeTopic(topic); + _writeTopic(topic, true); } } @@ -351,16 +539,34 @@ * @param topic The topic to serialize. * @throws IOException In case of an error. */ - private void _writeTopic(Topic topic) throws IOException { + private void _writeTopic(Topic topic, boolean topicTypeHeader) throws IOException { + final Reference mainIdentity = _getTopicReference(topic); + Topic[] types = _getTypes(topic); + if (topicTypeHeader) { + if (types.length > 0) { + Reference ref = _getTopicReference(types[0]); + if (!ref.equals(_lastReference)) { + _writeSection("TT: " + ref); + _lastReference = ref; + } + } + else if (_UNTYPED_REFERENCE != _lastReference) { + _writeSection("TT: " + _UNTYPED_REFERENCE); + _lastReference = _UNTYPED_REFERENCE; + } + } + boolean wantSemicolon = false; _newline(); - boolean wantSemicolon = false; - final TopicReference mainIdentity = _getTopicReference(topic); _writeTopicRef(mainIdentity); _out.write(' '); - for (Topic type: topic.getTypes()) { + for (Topic type: types) { _writeTypeInstance(type, wantSemicolon); wantSemicolon = true; } + for (Topic supertype: _getSupertypes(topic)) { + this._writeSupertypeSubtype(supertype, wantSemicolon); + wantSemicolon = true; + } for (Name name: _getNames(topic)) { _writeName((IName) name, wantSemicolon); wantSemicolon = true; @@ -369,74 +575,143 @@ _writeOccurrence((IOccurrence) occ, wantSemicolon); wantSemicolon = true; } - for (TopicReference sid: _getSubjectIdentifiers(topic)) { + for (Reference sid: _getSubjectIdentifiers(topic)) { _writeTopicRef(sid, wantSemicolon); wantSemicolon = true; } - for (TopicReference slo: _getSubjectLocators(topic)) { + for (Reference slo: _getSubjectLocators(topic)) { _writeTopicRef(slo, wantSemicolon); wantSemicolon = true; } if (_exportIIDs) { - TopicReference[] iids = _getItemIdentifiers(topic); - if ((mainIdentity.type == TopicReference.ID - || mainIdentity.type == TopicReference.IID) - && iids.length == 1) { - //TODO + for (Reference iid: _getItemIdentifiers(topic)) { + _writeTopicRef(iid, wantSemicolon); + wantSemicolon = true; } - else { - for (TopicReference iid: iids) { - _writeTopicRef(iid, wantSemicolon); - wantSemicolon = true; - } - } } - if (wantSemicolon) { - _out.write(' '); - } _out.write('.'); _newline(); } - private TopicReference[] _getSubjectIdentifiers(Topic topic) { - return _getLocators(topic, TopicReference.SID, topic.getSubjectIdentifiers()); + /** + * Returns a sorted array of subject identifiers for the specified topic. + * <p> + * The main identity (the one which starts the topic block) is removed + * is not part of the array iff the main identity is a subject identifier. + * </p> + * + * @param topic The topic to retrieve the subject identifiers from. + * @return A (maybe empty) sorted array of subject identifiers. + */ + private Reference[] _getSubjectIdentifiers(Topic topic) { + return _getLocators(topic, Reference.SID); } - private TopicReference[] _getSubjectLocators(Topic topic) { - return _getLocators(topic, TopicReference.SLO, topic.getSubjectLocators()); + /** + * Returns a sorted array of subject locators for the specified topic. + * <p> + * The main identity (the one which starts the topic block) is removed + * is not part of the array iff the main identity is a subject locator. + * </p> + * + * @param topic The topic to retrieve the subject locators from. + * @return A (maybe empty) sorted array of subject locators. + */ + private Reference[] _getSubjectLocators(Topic topic) { + return _getLocators(topic, Reference.SLO); } - private TopicReference[] _getItemIdentifiers(Topic topic) { - return _getLocators(topic, TopicReference.IID, topic.getItemIdentifiers()); + /** + * Returns a sorted array of item identifiers for the specified topic. + * <p> + * The main identity (the one which starts the topic block) is removed + * is not part of the array iff the main identity is an item identifier. + * </p> + * + * @param topic The topic to retrieve the item identifiers from. + * @return A (maybe empty) sorted array of item identifiers. + */ + private Reference[] _getItemIdentifiers(Topic topic) { + Collection<Locator> iids = topic.getItemIdentifiers(); + if (iids.isEmpty()) { + return _EMPTY_REFERENCE_ARRAY; + } + Collection<Reference> refs = new ArrayList<Reference>(); + for (Locator iid: iids) { + refs.add(Reference.createItemIdentifier(iid)); + } + Reference mainIdentity = _getTopicReference(topic); + if (!refs.remove(mainIdentity) + && mainIdentity.type == Reference.ID) { + String iri = _baseIRI + "#" + mainIdentity.reference; + for (Reference r: refs) { + if (r.reference.equals(iri)) { + refs.remove(r); + break; + } + } + } + Reference[] refArray = refs.toArray(new Reference[refs.size()]); + Arrays.sort(refArray); + return refArray; } - private TopicReference[] _getLocators(Topic topic, int kind, Set<Locator> locs) { + /** + * Returns a sorted array of {@link Reference}s which represent the + * provided locators. + * <p> + * The main identity is not part of the array. + * </p> + * + * @param topic The topic. + * @param kind Either {@link Reference#SID} or {@link Reference#SLO}. + * @return A (maybe empty) sorted array. + */ + private Reference[] _getLocators(Topic topic, int kind) { + Set<Locator> locs = kind == Reference.SID ? topic.getSubjectIdentifiers() + : topic.getSubjectLocators(); if (locs.isEmpty()) { - return new TopicReference[0]; + return _EMPTY_REFERENCE_ARRAY; } - Collection<TopicReference> refs = new ArrayList<TopicReference>(locs.size()); - if (kind == TopicReference.SID) { - for (Locator loc: locs) { - refs.add(TopicReference.createSubjectIdentifier(loc.toExternalForm())); - } + Collection<Reference> refs = new ArrayList<Reference>(locs.size()); + for (Locator loc: locs) { + refs.add(new Reference(kind, loc)); } - else if (kind == TopicReference.IID) { - for (Locator loc: locs) { - refs.add(TopicReference.createItemIdentifier(loc.toExternalForm())); - } - } - else if (kind == TopicReference.SLO) { - for (Locator loc: locs) { - refs.add(TopicReference.createSubjectLocator(loc.toExternalForm())); - } - } - refs.remove(_getTopicReference(topic)); - TopicReference[] refArray = refs.toArray(new TopicReference[refs.size()]); - //Arrays.sort(locArray, _locComparator); + refs.remove(_getTopicReference(topic)); + Reference[] refArray = refs.toArray(new Reference[refs.size()]); + Arrays.sort(refArray); return refArray; } /** + * Returns a sorted array of types for the specified topic. + * + * @param topic The topic to retrieve the types from. + * @return A sorted array of types. + */ + private Topic[] _getTypes(Topic topic) { + Set<Topic> types_ = topic.getTypes(); + Topic[] types = types_.toArray(new Topic[types_.size()]); + Arrays.sort(types, _topicIdComparator); + return types; + } + + /** + * Returns a sorted array of supertypes for the specified topic. + * + * @param topic The topic to retrieve the supertypes from. + * @return A sorted array of supertypes. + */ + private Topic[] _getSupertypes(Topic topic) { + //FIXME + return new Topic[0]; +// Set<Topic> supertypes_ = TypeInstanceUtils.getSupertypes(topic); +// Topic[] supertypes = supertypes_.toArray(new Topic[supertypes_.size()]); +// Arrays.sort(supertypes, _topicIdComparator); +// return supertypes; + } + + /** * Returns a sorted array of names for the specified topic. * * @param topic The topic to retrieve the names from. @@ -463,9 +738,9 @@ } /** - * + * Writes a type-instance relationship via "isa". * - * @param type + * @param type The type to write. * @param wantSemicolon Indicates if a semicolon should be written. * @throws IOException In case of an error. */ @@ -475,11 +750,18 @@ _writeTopicRef(type); } -// private void _writeSupertypeSubtype(Topic supertype, boolean wantSemicolon) throws IOException { -// _writeSemicolon(wantSemicolon); -// _out.write("ako "); -// _writeTopicRef(supertype); -// } + /** + * Writes a supertype-subtype relationship via "isa". + * + * @param supertype The supertype to write. + * @param wantSemicolon Indicates if a semicolon should be written. + * @throws IOException In case of an error. + */ + private void _writeSupertypeSubtype(Topic supertype, boolean wantSemicolon) throws IOException { + _writeSemicolon(wantSemicolon); + _out.write("ako "); + _writeTopicRef(supertype); + } /** * Serializes the specified occurrence. @@ -548,19 +830,10 @@ _out.write('('); Role[] roles = assoc.getRoles().toArray(new Role[0]); Arrays.sort(roles, _roleComparator); - boolean wantComma = false; - for (Role role: roles) { - if (wantComma) { - _out.write(", "); - } - _writeTopicRef(role.getType()); - _out.write(": "); - _writeTopicRef(role.getPlayer()); - if (role.getReifier() != null) { - _writeReifier(role); - _out.write(" #( Great, you found a reason why a role should be reified, please tell us about it :) )# "); - } - wantComma = true; + _writeRole(roles[0]); + for (int i=1; i<roles.length; i++) { + _out.write(", "); + _writeRole(roles[i]); } _out.write(')'); _writeScope((IScoped) assoc); @@ -569,6 +842,22 @@ } /** + * Serializes the specified association role. + * + * @param role The association role to serialize. + * @throws IOException In case of an error. + */ + private void _writeRole(Role role) throws IOException { + _writeTopicRef(role.getType()); + _out.write(": "); + _writeTopicRef(role.getPlayer()); + if (role.getReifier() != null) { + _writeReifier(role); + _out.write(" #( Great, you found a reason why a role should be reified, please tell us about it :) )# "); + } + } + + /** * Writes a semicolon and a newline character iff <tt>wantSemicolon</tt> is * <tt>true</tt>. * <p> @@ -583,9 +872,7 @@ if (wantSemicolon) { _out.write(';'); _newline(); - if (_prettify) { - _out.write(" "); - } + _out.write(_indent); } } @@ -600,21 +887,18 @@ IScope scope = scoped.getScopeObject(); if (!scope.isUnconstrained()) { Topic[] themes = scope.asSet().toArray(new Topic[scope.size()]); - Arrays.sort(themes, _topicComparator); + Arrays.sort(themes, _topicIdComparator); _out.write(" @"); - boolean wantComma = false; - for (Topic theme: themes) { - if (wantComma) { - _out.write(", "); - } - _writeTopicRef(theme); - wantComma = true; + _writeTopicRef(themes[0]); + for (int i=1; i<themes.length; i++) { + _out.write(", "); + _writeTopicRef(themes[i]); } } } /** - * Writes the reifier if <tt>reifiable</tt> is reified. + * Writes the reifier iff <tt>reifiable</tt> is reified. * * @param reifiable The reifiable construct. * @throws IOException If an error occurs. @@ -653,21 +937,14 @@ else { _writeString(value); _out.write("^^"); - String datatypeIRI = datatype.toExternalForm(); - if (datatypeIRI.startsWith(Namespace.XSD)) { - _out.write("xsd:"); - _out.write(datatypeIRI.substring(datatypeIRI.lastIndexOf('#')+1)); - } - else { - _writeLocator(datatypeIRI); - } + _writeLocator(datatype); } } /** - * + * Writes a topic reference for the specified topic. * - * @param topic + * @param topic The topic to serialize. * @throws IOException In case of an error. */ private void _writeTopicRef(Topic topic) throws IOException { @@ -675,35 +952,35 @@ } /** - * + * Writes the specied topic reference without whitespaces in front. * - * @param topicRef + * @param topicRef The topic reference to serialize. * @throws IOException In case of an error. */ - private void _writeTopicRef(TopicReference topicRef) throws IOException { + private void _writeTopicRef(Reference topicRef) throws IOException { _writeTopicRef(topicRef, false); } /** - * + * Writes the specified topic reference. * - * @param topicRef + * @param topicRef The topic reference to write. * @param wantSemicolon Indicates if a semicolon should be written. * @throws IOException In case of an error. */ - private void _writeTopicRef(TopicReference topicRef, boolean wantSemicolon) throws IOException { + private void _writeTopicRef(Reference topicRef, boolean wantSemicolon) throws IOException { _writeSemicolon(wantSemicolon); switch (topicRef.type) { - case TopicReference.ID: + case Reference.ID: _out.write(topicRef.reference); return; - case TopicReference.IID: + case Reference.IID: _out.write('^'); break; - case TopicReference.SLO: + case Reference.SLO: _out.write("= "); break; - case TopicReference.SID: + case Reference.SID: break; default: throw new RuntimeException("Internal error: Cannot match topic reference type " + topicRef.type); @@ -712,85 +989,188 @@ } /** - * + * Serializes the provided <tt>string</tt>. + * <p> + * This method recognizes characters which have to be escaped. + * </p> * - * @param string - * @throws IOException + * @param string The string to write. + * @throws IOException In case of an error. */ private void _writeString(String string) throws IOException { - _out.write('"'); - char[] ch = string.toCharArray(); - for (int i=0; i<ch.length; i++) { - switch (ch[i]) { - case '"': - case '\\': - _out.write("\\"); - default: - _out.write(ch[i]); + // Avoid escaping of " + if (string.indexOf('"') > 0 && !string.endsWith("\"")) { + _out.write(_TRIPLE_QUOTES); + char[] ch = string.toCharArray(); + for (int i=0; i<ch.length; i++) { + switch (ch[i]) { + case '\\': + _out.write("\\"); + default: + _out.write(ch[i]); + } } + _out.write(_TRIPLE_QUOTES); } - _out.write('"'); + else { + // Either the string ends with a " or the string is a 'normal' string + _out.write('"'); + char[] ch = string.toCharArray(); + for (int i=0; i<ch.length; i++) { + switch (ch[i]) { + case '"': + case '\\': + _out.write("\\"); + default: + _out.write(ch[i]); + } + } + _out.write('"'); + } } - private void _writeLocator(String reference) throws IOException { - _out.write("<" + reference + ">"); + /** + * Writes the specified locator (maybe abbreviated as QName). + * + * @param loc The locator to write. + * @throws IOException In case of an error. + */ + private void _writeLocator(final Locator loc) throws IOException { + _writeLocator(loc.toExternalForm()); } - private TopicReference _getTopicReference(Topic topic) { - TopicReference ref = _topic2Reference.get(topic); - if (ref == null) { - final boolean hasIIds = !(_exportIIDs || topic.getItemIdentifiers().isEmpty()); - final boolean hasSids = !topic.getSubjectIdentifiers().isEmpty(); - final boolean hasSlos = !topic.getSubjectLocators().isEmpty(); - if (!hasIIds) { - if (hasSids) { - ref = hasSlos ? null : TopicReference.createSubjectIdentifier(topic.getSubjectIdentifiers().iterator().next().toExternalForm()); - } - else if (hasSlos) { - ref = TopicReference.createSubjectLocator(topic.getSubjectLocators().iterator().next().toExternalForm()); - } + /** + * Writes the specified locator <tt>reference</tt> which has been + * externalized.. + * <p> + * If the reference starts with the base IRI followed by a hash ('#'), the + * reference is abbreviated. + * </p> + * + * @param reference The reference to write. + * @throws IOException In case of an error. + */ + private void _writeLocator(String reference) throws IOException { + // If the reference starts with the base IRI and is followed by a # + // a relative reference is written + if (reference.startsWith(_baseIRI)) { + String tmp = reference.substring(_baseIRI.length()); + if (tmp.charAt(0) == '#') { + _out.write('<' + tmp + '>'); + return; } - if (ref == null) { - if (topic.getItemIdentifiers().size() == 1) { - final String iid = topic.getItemIdentifiers().iterator().next().toExternalForm(); - int idx = !iid.startsWith(_baseIRI) ? -1 : iid.lastIndexOf('#'); - if (idx > 0) { - String id = iid.substring(idx + 1); - ref = _isValidId(id) ? TopicReference.createId(id) - : TopicReference.createItemIdentifier("#" + id); - } - else { - ref = TopicReference.createItemIdentifier(iid); - } + } + // If no relative IRI was written, check the registered prefixes and + // write a QName if a prefix matches + for (Map.Entry<String, String> entry: _prefixes.entrySet()) { + String iri = entry.getValue(); + if (reference.startsWith(iri)) { + String localPart = reference.substring(iri.length()); + if (_isValidLocalPart(localPart)) { + _out.write(entry.getKey()); + _out.write(':'); + _out.write(localPart); + return; } } - if (ref == null) { - String iri = null; - for (Locator iid: topic.getItemIdentifiers()) { - String addr = iid.getReference(); - int idx = addr.lastIndexOf('#'); - if (idx < 0) { - continue; + } + // No relative IRI and no QName was written, write the reference as it is + _out.write('<' + reference + '>'); + } + + /** + * Returns a reference to the provided topic. + * <p> + * The reference to the topic stays stable during the serialization of + * the topic map. + * </p> + * + * @param topic The topic to retrieve a reference for. + * @return A reference to the specified topic. + */ + private Reference _getTopicReference(Topic topic) { + Reference ref = _topic2Reference.get(topic); + if (ref == null) { + ref = _generateTopicReference(topic); + _topic2Reference.put(topic, ref); + } + return ref; + } + + /** + * Returns a reference to the specified <tt>topic</tt>. + * + * @param topic The topic to generate a reference for. + * @return A reference to the specified topic. + */ + private Reference _generateTopicReference(final Topic topic) { + Reference ref = null; + Collection<Reference> refs = new ArrayList<Reference>(); + for (Locator iid: topic.getItemIdentifiers()) { + String addr = iid.toExternalForm(); + int idx = addr.indexOf('#'); + if (idx > 0) { + String id = addr.substring(idx+1); + if (_isValidId(id)) { + if (_keepAbsoluteIIDs && !addr.startsWith(_baseIRI)) { + refs.add(Reference.createItemIdentifier(iid)); } else { - String id = addr.substring(idx+1); - iri = _isValidId(id) ? id : null; + refs.add(Reference.createId(id)); } } - if (iri == null) { - iri = "id-" + topic.getId(); + else { + refs.add(Reference.createItemIdentifier(iid)); } - ref = TopicReference.createId(iri); } - _topic2Reference.put(topic, ref); } + if (refs.isEmpty()) { + for (Locator sid: topic.getSubjectIdentifiers()) { + refs.add(Reference.createSubjectIdentifier(sid)); + } + } + if (refs.isEmpty()) { + for (Locator sid: topic.getSubjectLocators()) { + refs.add(Reference.createSubjectLocator(sid)); + } + } + if (!refs.isEmpty()) { + Reference[] refArray = refs.toArray(new Reference[refs.size()]); + Arrays.sort(refArray); + ref = refArray[0]; + } + else { + ref = Reference.createItemIdentifier("#" + topic.getId()); + } return ref; } + /** + * Returns if the provided <tt>id</tt> is a valid CTM topic identifier. + * + * @param id The id to check. + * @return <tt>true</tt> if the id is valid, otherwise <tt>false</tt>. + */ private boolean _isValidId(String id) { return _ID_PATTERN.matcher(id).matches(); } + /** + * Returns if the provided <tt>id</tt> is a valid local part of a QName. + * + * @param id The id to check. + * @return <tt>true</tt> if the id is valid, otherwise <tt>false</tt>. + */ + private boolean _isValidLocalPart(String id) { + return _LOCAL_PATTERN.matcher(id).matches(); + } + + /** + * Returns if the provided <tt>literal</tt> is supported by CTM natively. + * + * @param literal The literal to check. + * @return <tt>true</tt> if the literal is supported, else <tt>false</tt>. + */ private boolean _isNativelySupported(ILiteral literal) { Locator datatype = literal.getDatatype(); return XSD.STRING.equals(datatype) @@ -804,10 +1184,21 @@ || "-INF".equals(literal.getValue())); } + /** + * Writes a EOL character. + * + * @throws IOException In case of an error. + */ private void _newline() throws IOException { _out.write('\n'); } + /** + * Writes a section name. + * + * @param name The section name to write. + * @throws IOException In case of an error. + */ private void _writeSection(String name) throws IOException { _newline(); _newline(); @@ -827,9 +1218,10 @@ LOG.warning("Invalid CTM: '" + msg + "'"); } - - - private static final class TopicReference { + /** + * Represents a reference to a topic. + */ + static final class Reference implements Comparable<Reference> { static final int ID = 0, SID = 1, @@ -838,28 +1230,60 @@ final int type; final String reference; - private TopicReference(int type, String reference) { + private Reference(int type, String reference) { this.type = type; this.reference = reference; } - public static TopicReference createId(String reference) { - return new TopicReference(ID, reference); + public Reference(int type, Locator loc) { + this(type, loc.toExternalForm()); } + + public static Reference createId(String reference) { + return new Reference(ID, reference); + } - public static TopicReference createSubjectIdentifier(String reference) { - return new TopicReference(SID, reference); + public static Reference createSubjectIdentifier(Locator reference) { + return new Reference(SID, reference); } - public static TopicReference createSubjectLocator(String reference) { - return new TopicReference(SLO, reference); + public static Reference createSubjectLocator(Locator reference) { + return new Reference(SLO, reference); } - public static TopicReference createItemIdentifier(String reference) { - return new TopicReference(IID, reference); + public static Reference createItemIdentifier(String string) { + return new Reference(IID, string); } + public static Reference createItemIdentifier(Locator reference) { + return createItemIdentifier(reference.toExternalForm()); + } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder buff = new StringBuilder(); + switch (type) { + case Reference.ID: + return reference; + case Reference.IID: + buff.append('^'); + break; + case Reference.SID: + break; + case Reference.SLO: + buff.append("= "); + break; + } + buff.append('<'); + buff.append(reference); + buff.append('>'); + return buff.toString(); + } + + /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -867,11 +1291,11 @@ if (this == obj) { return true; } - if (!(obj instanceof TopicReference)) { + if (!(obj instanceof Reference)) { return false; } - TopicReference other = (TopicReference) obj; - return (type == other.type && reference.equals(other.reference)); + Reference other = (Reference) obj; + return type == other.type && reference.equals(other.reference); } /* (non-Javadoc) @@ -882,6 +1306,18 @@ return type + reference.hashCode(); } + /* (non-Javadoc) + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + @Override + public int compareTo(Reference o) { + int res = type - o.type; + if (res == 0) { + res = reference.compareTo(o.reference); + } + return res; + } + } @@ -889,33 +1325,33 @@ * Comparators. */ - /** - * Topic comparator. - * - Topics with less types are considered less than others with types. - * - Topics with less subject identifiers are considered less than others with sids. - * - Topics with less subject locators are considered less than other with slos - * - Topics with less item identifiers are less than others with iids - * - */ - private final class TopicComparator implements Comparator<Topic> { + private class TopicIdComparator implements Comparator<Topic> { /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ @Override public int compare(Topic o1, Topic o2) { - if (o1 == o2) { - return 0; - } - int res = o1.getTypes().size() - o2.getTypes().size(); + return _getTopicReference(o1).compareTo(_getTopicReference(o2)); + } + } + + private class TopicComparator implements Comparator<Topic> { + + private final TopicTypeSetComparator _typesComparator; + + TopicComparator() { + _typesComparator = new TopicTypeSetComparator(); + } + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Topic o1, Topic o2) { + int res = _typesComparator.compare(o1.getTypes(), o2.getTypes()); if (res == 0) { - res = _locSetComparator.compare(o1.getSubjectIdentifiers(), o2.getSubjectIdentifiers()); - if (res == 0) { - res = _locSetComparator.compare(o1.getSubjectLocators(), o2.getSubjectLocators()); - if (res == 0) { - res = _locSetComparator.compare(o1.getItemIdentifiers(), o2.getItemIdentifiers()); - } - } + res = _getTopicReference(o1).compareTo(_getTopicReference(o2)); } return res; } @@ -948,7 +1384,7 @@ * second. */ int compareType(Typed o1, Typed o2) { - return _topicComparator.compare(o1.getType(), o2.getType()); + return _topicIdComparator.compare(o1.getType(), o2.getType()); } /** * Extracts the scope of the scoped Topic Maps constructs and compares @@ -976,6 +1412,9 @@ int compareReifier(Reifiable o1, Reifiable o2) { Topic reifier1 = o1.getReifier(); Topic reifier2 = o2.getReifier(); + if (reifier1 == reifier2) { + return 0; + } int res = 0; if (reifier1 == null) { res = reifier2 == null ? 0 : -1; @@ -983,7 +1422,7 @@ else if (reifier2 == null) { res = 1; } - return res != 0 ? res : _topicComparator.compare(reifier1, reifier2); + return res != 0 ? res : _topicIdComparator.compare(reifier1, reifier2); } } @@ -1030,7 +1469,7 @@ private Comparator<Set<Role>> _roleSetComparator; AssociationComparator() { - //_roleSetComparator = new RoleSetComparator(); + _roleSetComparator = new RoleSetComparator(); } /* (non-Javadoc) @@ -1043,7 +1482,7 @@ } int res = compareType(o1, o2); if (res == 0) { - //res = _roleSetComparator.compare(o1.getRoles(), o2.getRoles()); + res = _roleSetComparator.compare(o1.getRoles(), o2.getRoles()); if (res == 0) { res = compareScope(o1, o2); } @@ -1069,7 +1508,7 @@ } int res = compareType(o1, o2); if (res == 0) { - res = _topicComparator.compare(o1.getPlayer(), o2.getPlayer()); + res = _topicIdComparator.compare(o1.getPlayer(), o2.getPlayer()); } return res; } @@ -1220,59 +1659,71 @@ } /** - * Compares the scope of two scoped Topic Maps constructs. + * Compares role sets. The parent of the roles is ignored! */ - private final class ScopeComparator extends AbstractSetComparator<Topic> { + private final class RoleSetComparator extends AbstractSetComparator<Role> { + private RoleComparator _roleCmp; + + RoleSetComparator() { + _roleCmp = new RoleComparator(); + } + + /* (non-Javadoc) + * @see org.tinytim.mio.CXTMTopicMapWriter.AbstractSetComparator#compareContent(java.util.Set, java.util.Set, int) + */ @Override - int compareContent(Set<Topic> o1, Set<Topic> o2, int size) { - int res = 0 ; - Topic[] topics1 = o1.toArray(new Topic[size]); - Topic[] topics2 = o2.toArray(new Topic[size]); - Arrays.sort(topics1, _topicComparator); - Arrays.sort(topics2, _topicComparator); + int compareContent(Set<Role> o1, Set<Role> o2, + int size) { + int res = 0; + Role[] roles1 = o1.toArray(new Role[size]); + Role[] roles2 = o2.toArray(new Role[size]); + Arrays.sort(roles1, _roleCmp); + Arrays.sort(roles2, _roleCmp); for (int i=0; i < size && res == 0; i++) { - res = _topicComparator.compare(topics1[i], topics2[i]); + res = _roleCmp.compare(roles1[i], roles2[i]); } return res; } } - /** - * Compares {@link org.tmapi.core.Locator}s. - */ - private final class LocatorComparator implements Comparator<Locator> { + private final class TopicTypeSetComparator extends AbstractSetComparator<Topic> { /* (non-Javadoc) - * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + * @see org.tinytim.mio.CXTMTopicMapWriter.AbstractSetComparator#compareContent(java.util.Set, java.util.Set, int) */ @Override - public int compare(Locator o1, Locator o2) { - if (o1 == o2) { - return 0; + int compareContent(Set<Topic> o1, Set<Topic> o2, + int size) { + int res = 0; + Topic[] types1 = o1.toArray(new Topic[size]); + Topic[] types2 = o2.toArray(new Topic[size]); + Arrays.sort(types1, _topicIdComparator); + Arrays.sort(types2, _topicIdComparator); + for (int i=0; i < size && res == 0; i++) { + res = _topicIdComparator.compare(types1[i], types2[i]); } - return o1.getReference().compareTo(o2.getReference()); + return res; } - } /** - * Comparator for sets of {@link org.tmapi.core.Locator}s. + * Compares the scope of two scoped Topic Maps constructs. */ - private final class LocatorSetComparator extends AbstractSetComparator<Locator> { + private final class ScopeComparator extends AbstractSetComparator<Topic> { /* (non-Javadoc) * @see org.tinytim.mio.CTMTopicMapWriter.AbstractSetComparator#compareContent(java.util.Set, java.util.Set, int) */ @Override - int compareContent(Set<Locator> o1, Set<Locator> o2, int size) { - int res = 0; - Locator[] locs1 = o1.toArray(new Locator[size]); - Locator[] locs2 = o2.toArray(new Locator[size]); - Arrays.sort(locs1, _locComparator); - Arrays.sort(locs2, _locComparator); + int compareContent(Set<Topic> o1, Set<Topic> o2, int size) { + int res = 0 ; + Topic[] topics1 = o1.toArray(new Topic[size]); + Topic[] topics2 = o2.toArray(new Topic[size]); + Arrays.sort(topics1, _topicIdComparator); + Arrays.sort(topics2, _topicIdComparator); for (int i=0; i < size && res == 0; i++) { - res = _locComparator.compare(locs1[i], locs2[i]); + res = _topicIdComparator.compare(topics1[i], topics2[i]); } return res; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-08 14:47:06
|
Revision: 281 http://tinytim.svn.sourceforge.net/tinytim/?rev=281&view=rev Author: lheuer Date: 2009-03-08 14:46:50 +0000 (Sun, 08 Mar 2009) Log Message: ----------- Added prefixes Modified Paths: -------------- topicmaps/opera.ctm Modified: topicmaps/opera.ctm =================================================================== --- topicmaps/opera.ctm 2009-03-07 10:02:29 UTC (rev 280) +++ topicmaps/opera.ctm 2009-03-08 14:46:50 UTC (rev 281) @@ -19,9 +19,25 @@ )# -%prefix xsd <http://www.w3.org/2001/XMLSchema#> # Default prefix +#-- Prefixes +%prefix bio <http://psi.ontopia.net/biography/> +%prefix city <http://psi.ontopia.net/city/> +%prefix country <http://www.topicmaps.org/xtm/1.0/country.xtm#> +%prefix dc <http://purl.org/dc/elements/1.1/> +%prefix geo <http://psi.ontopia.net/geography/> +%prefix hier <http://www.techquila.com/psi/hierarchy/#> +%prefix lang <http://www.topicmaps.org/xtm/1.0/language.xtm#> +%prefix lit <http://psi.ontopia.net/literature/> +%prefix meta <http://psi.ontopia.net/metadata/> +%prefix music <http://psi.ontopia.net/music/> +%prefix opera <http://psi.ontopia.net/opera/> +%prefix wp <http://en.wikipedia.org/wiki/> +%prefix xtm <http://www.topicmaps.org/xtm/1.0/core.xtm#> + + + #-- Topic Map ~ operatm @@ -40,42 +56,42 @@ #-- Topic Types Format - "Format"; - <http://purl.org/dc/elements/1.1/format>. + dc:format. Type - "Type"; - <http://purl.org/dc/elements/1.1/type>. + dc:type. aria isa artform; - "Aria"; - <http://psi.ontopia.net/music/aria>. + music:aria. artform - "Art form"; - "Kunstart" @norwegian; - <http://psi.ontopia.net/opera/artform>. + opera:artform. ballet isa artform; - "Ballet"; - "Ballett" @norwegian; - <http://psi.ontopia.net/music/ballet>. + music:ballet. cause-of-death - "Cause of death"; - "Dødsarsåk" @norwegian; - <http://psi.ontopia.net/biography/cause-of-death>. + bio:cause-of-death. character - "Character"; - "Skikkelse" @norwegian; - <http://psi.ontopia.net/literature/character>. + lit:character. chorus isa artform; - "Chorus"; - <http://psi.ontopia.net/music/chorus>. + music:chorus. city - "City" ("Cities" @plural); - "Ville" @french; - "Stadt" @german; - "Città" @italian ("Citta" @sort); - "By" @norwegian; - <http://psi.ontopia.net/geography/city>. + geo:city. codetype - "Code type"; - "Kodetype" @norwegian; @@ -94,22 +110,22 @@ - "Композитор" @russian; - "Cyfansoddwr" @welsh; - "Komponist" @dutch, german, norwegian; - <http://psi.ontopia.net/music/composer>. + music:composer. conservatory - "Conservatory"; - "Konservatorium" @norwegian; - <http://psi.ontopia.net/music/conservatory>. + music:conservatory. country - "Country" ("Countries" @plural); - "Pays" @french; - "Paese" @italian; - "Land" @german, norwegian; - <http://psi.ontopia.net/geography/country>. + geo:country. dictionary isa artform; - "Dictionary"; - "Leksikon" @norwegian; - <http://psi.ontopia.net/literature/dictionary>. + lit:dictionary. domain - "Subject domain"; - "Emneområde" @norwegian; @@ -121,7 +137,7 @@ hierarchical-relation-type - "Hierarchical relation type"; - "Hierarkisk relasjonstype" @norwegian; - <http://www.techquila.com/psi/hierarchy/#hierarchical-relation-type>. + hier:hierarchical-relation-type. language - "Language"; - "Kieli" @finnish; @@ -129,11 +145,11 @@ - "Sprache" @german; - "Lingua" @italian; - "Språk" @norwegian; - <http://psi.ontopia.net/opera/language>. + opera:language. librettist - "Librettist"; guidelines: "A person who has written one or more libretti for an opera. Composers who have written their own libretti do not qualify unless they have written libretti for other composers (like Boito and Leoncavallo)."; - <http://psi.ontopia.net/opera/librettist>. + opera:librettist. metadata - "Metadata"; <http://psi.ontopia.net/occurrence/metadata>. @@ -141,7 +157,7 @@ musician - "Musician"; - "Musiker" @norwegian; guidelines: "Used in this topic map for people who were teachers of composers but are not themselves classified as composers."; - <http://psi.ontopia.net/music/musician>. + music:musician. nameform - "Name form"; - "Navneform" @norwegian; @@ -153,16 +169,16 @@ <http://psi.ontopia.net/basename/name-type>. network-location - "Network location"; - <http://psi.ontopia.net/opera/network-location>. + opera:network-location. novel isa artform; - "Novel"; - "Roman" @norwegian; - <http://psi.ontopia.net/literature/novel>. + lit:novel. novella isa artform; - "Novella"; - <http://psi.ontopia.net/literature/novella>. + lit:novella. opera isa artform; - "Opera"; @@ -181,207 +197,207 @@ guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/opera.htm> @ontopus, web; webpage: <http://home.prcn.org/~pauld/opera/> @web ~ pauld-website; website: <http://opera.stanford.edu>; - <http://psi.ontopia.net/music/opera>. + music:opera. place - "Place"; - "Sted" @norwegian; - <http://psi.ontopia.net/geography/place>. + geo:place. play isa artform; - "Play"; - "Skuespill" @norwegian; - <http://psi.ontopia.net/literature/play>. + lit:play. playwright - "Playwright"; - "Dramatiker" @norwegian; - <http://psi.ontopia.net/literature/playwright>. + lit:playwright. poem isa artform; - "Poem"; - "Dikt" @norwegian; - <http://psi.ontopia.net/literature/poem>. + lit:poem. producer - "Producer"; - "Produsent" @norwegian; - <http://psi.ontopia.net/opera/producer>. + opera:producer. publication - "Publication"; - "Utgivelse" @norwegian; - <http://psi.ontopia.net/literature/publication>. + lit:publication. publisher - "Publisher"; - "Utgiver" @norwegian; - <http://psi.ontopia.net/literature/publisher>. + lit:publisher. region - "Region"; guidelines: <http://localhost:8080/operamap/occurs/region.htm> @local, ontopus; guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/region.htm> @ontopus, web; - <http://psi.ontopia.net/geography/region>. + geo:region. style - "Style"; - "Stil" @norwegian; - <http://psi.ontopia.net/opera/style>. + opera:style. subordinate-role-type - "Subordinate role type"; - <http://www.techquila.com/psi/hierarchy/#subordinate-role-type>. + hier:subordinate-role-type. superordinate-role-type - "Superordinate role type"; - <http://www.techquila.com/psi/hierarchy/#superordinate-role-type>. + hier:superordinate-role-type. theatre - "Theatre"; - "Teater" @norwegian; - <http://psi.ontopia.net/literature/theatre>. + lit:theatre. triptych isa artform; - "Triptych"; - <http://psi.ontopia.net/music/triptych>. + music:triptych. tv - "TV company"; - "TV-selskap" @norwegian; - <http://psi.ontopia.net/opera/tv>. + opera:tv. voice-type - "Voice type"; - "Stemmetype" @norwegian; - <http://psi.ontopia.net/music/voice-type>. + music:voice-type. work - "Work"; - "Verk" @norwegian; - <http://psi.ontopia.net/literature/work>. + lit:work. writer - "Writer"; - "Skribent" @norwegian; - <http://psi.ontopia.net/literature/writer>. + lit:writer. #-- Association Types Creator - "Creator"; - "Skaper" @norwegian; - <http://purl.org/dc/elements/1.1/creator>. + dc:creator. Format - "Format"; - <http://purl.org/dc/elements/1.1/format>. + dc:format. Language - "Language"; - <http://purl.org/dc/elements/1.1/language>. + dc:language. Publisher - "Publisher"; - "Utgiver" @norwegian; - <http://purl.org/dc/elements/1.1/publisher>. + dc:publisher. Subject - "Subject(s)"; - "Tema(er)" @norwegian; - "Subject of" @value; - "Tema for" @norwegian, value; - <http://purl.org/dc/elements/1.1/subject>. + dc:subject. Type - "Type"; - <http://purl.org/dc/elements/1.1/type>. + dc:type. appears-in - "Appears in"; - "Dramatis personae" @work; - <http://psi.ontopia.net/literature/appears-in>. + lit:appears-in. based-on - "Based on"; - "Source of" @source; - <http://psi.ontopia.net/opera/based-on>. + opera:based-on. born-in - "Born in"; - "Birthplace of" @place; - <http://psi.ontopia.net/biography/born-in>. + bio:born-in. completed-by - "Completed by"; - "Completed" @composer; - <http://psi.ontopia.net/music/completed-by>. + music:completed-by. composed-by - "Composed by"; - "Composed" @composer; - <http://psi.ontopia.net/music/composed-by>. + music:composed-by. died-in - "Died in"; - "Died here" @place; - <http://psi.ontopia.net/biography/died-in>. + bio:died-in. exponent-of - "Exponent of"; - "Represented by" @style; - <http://psi.ontopia.net/biography/exponent-of>. + bio:exponent-of. has-voice - "Has voice type"; - <http://psi.ontopia.net/music/has-voice>. + music:has-voice. killed-by - "Killed by"; - "Kills (by)" @cause-of-death, perpetrator; - <http://psi.ontopia.net/biography/killed-by>. + bio:killed-by. libretto-by - "Libretto by"; - "Wrote libretto for" @librettist; - <http://psi.ontopia.net/literature/libretto-by>. + lit:libretto-by. located-in isa hierarchical-relation-type; - "Located in"; - "Contains" @container; - <http://psi.ontopia.net/geography/located-in>. + geo:located-in. part-of - "Contains"; - "Part of" @part; - <http://psi.ontopia.net/opera/part-of>. + opera:part-of. premiere - "First performed at"; - "Hosted première of" @place; - <http://psi.ontopia.net/opera/premiere>. + opera:premiere. published-by - "Published by"; - "Publisher of" @publisher; - <http://psi.ontopia.net/literature/published-by>. + lit:published-by. pupil-of - "Teacher/pupil"; - "Pupil of" @pupil; - "Teacher of" @teacher; descr: "A relationship between a pupil and his teacher. The Italian Opera Topic Map only includes teachers of composition."; - <http://psi.ontopia.net/biography/pupil-of>. + bio:pupil-of. revision-of - "Revision of"; - "Revised as" @source; - <http://psi.ontopia.net/opera/revision-of>. + opera:revision-of. subtype-of isa hierarchical-relation-type; - "Subtype of"; - "Supertype of" @supertype; - <http://www.topicmaps.org/xtm/1.0/core.xtm#superclass-subclass>. + xtm:superclass-subclass. sung-by - "Sung by"; - "Sings" @person; - <http://psi.ontopia.net/music/sung-by>. + music:sung-by. takes-place-during - "Takes place during"; - "Setting for" @event; - <http://psi.ontopia.net/opera/takes-place-during>. + opera:takes-place-during. takes-place-in - "Takes place in"; - "Setting for" @place; - <http://psi.ontopia.net/opera/takes-place-in>. + opera:takes-place-in. unfinished - "Unfinished"; <http://psi.ontopia.net/xtm/association-type/unfinished>. written-by - "Written by"; - "Wrote" @writer; - <http://psi.ontopia.net/literature/written-by>. + lit:written-by. #-- Role Types aria isa artform; - "Aria"; - <http://psi.ontopia.net/music/aria>. + music:aria. cause-of-death - "Cause of death"; - "Dødsarsåk" @norwegian; - <http://psi.ontopia.net/biography/cause-of-death>. + bio:cause-of-death. character - "Character"; - "Skikkelse" @norwegian; - <http://psi.ontopia.net/literature/character>. + lit:character. composer - "Composer"; - "Skladatel" @czech; @@ -396,15 +412,15 @@ - "Композитор" @russian; - "Cyfansoddwr" @welsh; - "Komponist" @dutch, german, norwegian; - <http://psi.ontopia.net/music/composer>. + music:composer. containee isa subordinate-role-type; - "Containee"; - <http://psi.ontopia.net/geography/containee>. + geo:containee. container isa superordinate-role-type; - "Container"; - <http://psi.ontopia.net/geography/container>. + geo:container. event - "Historical event"; - "Historisk begivenhet" @norwegian; @@ -412,7 +428,7 @@ librettist - "Librettist"; guidelines: "A person who has written one or more libretti for an opera. Composers who have written their own libretti do not qualify unless they have written libretti for other composers (like Boito and Leoncavallo)."; - <http://psi.ontopia.net/opera/librettist>. + opera:librettist. opera isa artform; - "Opera"; @@ -431,155 +447,155 @@ guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/opera.htm> @ontopus, web; webpage: <http://home.prcn.org/~pauld/opera/> @web ~ pauld-website; website: <http://opera.stanford.edu>; - <http://psi.ontopia.net/music/opera>. + music:opera. part - "Part"; - <http://psi.ontopia.net/opera/part>. + opera:part. perpetrator - "Perpetrator"; - <http://psi.ontopia.net/biography/perpetrator>. + bio:perpetrator. person - "Person"; <http://psi.ontopia.net/person>. place - "Place"; - "Sted" @norwegian; - <http://psi.ontopia.net/geography/place>. + geo:place. publisher - "Publisher"; - "Utgiver" @norwegian; - <http://psi.ontopia.net/literature/publisher>. + lit:publisher. pupil - "Pupil"; - <http://psi.ontopia.net/biography/pupil>. + bio:pupil. resource - "Resource"; - "Ressurs" @norwegian; - <http://psi.ontopia.net/metadata/resource>. + meta:resource. result - "Result"; - <http://psi.ontopia.net/opera/result>. + opera:result. source - "Source"; - <http://psi.ontopia.net/opera/source>. + opera:source. style - "Style"; - "Stil" @norwegian; - <http://psi.ontopia.net/opera/style>. + opera:style. subtype isa subordinate-role-type; - "Subtype"; - <http://www.topicmaps.org/xtm/1.0/core.xtm#subclass>. + xtm:subclass. supertype isa superordinate-role-type; - "Supertype"; - <http://www.topicmaps.org/xtm/1.0/core.xtm#superclass>. + xtm:superclass. teacher - "Teacher"; - <http://psi.ontopia.net/biography/teacher>. + bio:teacher. value - "Value"; - "Verdi" @norwegian; - <http://psi.ontopia.net/metadata/value>. + meta:value. victim - "Victim"; - <http://psi.ontopia.net/biography/victim>. + bio:victim. voice-type - "Voice type"; - "Stemmetype" @norwegian; - <http://psi.ontopia.net/music/voice-type>. + music:voice-type. whole - "Whole"; - <http://psi.ontopia.net/opera/whole>. + opera:whole. work - "Work"; - "Verk" @norwegian; - <http://psi.ontopia.net/literature/work>. + lit:work. writer - "Writer"; - "Skribent" @norwegian; - <http://psi.ontopia.net/literature/writer>. + lit:writer. #-- Occurrence Types Date - "Date"; - "Dato" @norwegian; - <http://purl.org/dc/elements/1.1/date>. + dc:date. Description - "Description"; - "Beskrivelse" @norwegian; - <http://purl.org/dc/elements/1.1/description>. + dc:description. Rights - "Rights"; - "Rettigheter" @norwegian; - <http://purl.org/dc/elements/1.1/rights>. + dc:rights. article - "Article"; - <http://psi.ontopia.net/opera/article>. + opera:article. audio-recording - "Audio recording" ("Recording (audio)" @sort); descr: "An audio recording. In the Italian Opera topic map this is currently modelled extremely simply as an occurrence whose value is the catalogue number of some recording in the author's collection."; - <http://psi.ontopia.net/music/audio-recording>. + music:audio-recording. bibref - "Bibliography"; - <http://psi.ontopia.net/opera/bibref>. + opera:bibref. biographical-article - "Biographical article"; - <http://psi.ontopia.net/biography/biographical-article>. + bio:biographical-article. date-of-birth isa metadata; - "Date of birth"; - <http://psi.ontopia.net/biography/date-of-birth>. + bio:date-of-birth. date-of-death isa metadata; - "Date of death"; - <http://psi.ontopia.net/biography/date-of-death>. + bio:date-of-death. descr - "Description"; <http://psi.ontopia.net/occurrence/description>. gallery - "Gallery" ("Galleries" @plural); - <http://psi.ontopia.net/opera/gallery>. + opera:gallery. guidelines - "Editorial guidelines"; <http://psi.ontopia.net/occurrence/editorial-guidelines>. illustration - "Illustration"; - <http://psi.ontopia.net/opera/illustration>. + opera:illustration. libretto - "Libretto" ("Libretti" @plural); - <http://psi.ontopia.net/opera/libretto>. + opera:libretto. note isa metadata; - "Note"; - <http://psi.ontopia.net/opera/note>. + opera:note. poster - "Poster"; - <http://psi.ontopia.net/opera/poster>. + opera:poster. premiere-date isa metadata; - "Première date"; - <http://psi.ontopia.net/opera/premiere-date>. + opera:premiere-date. revision - "Revision"; <http://psi.ontopia.net/xtm/occurrence-type/revision>. sound-clip - "Sound clip"; - <http://psi.ontopia.net/music/sound-clip>. + music:sound-clip. synopsis - "Synopsis" ("Synopses" @plural); - <http://psi.ontopia.net/opera/synopsis>. + opera:synopsis. video-recording - "Video recording" ("Recording (video)" @sort); descr: "A video recording. In the Italian Opera topic map this is currently modelled extremely simply as an occurrence whose value is the catalogue number of some recording in the author's collection."; - <http://psi.ontopia.net/music/video-recording>. + music:video-recording. webpage - "Web page"; - <http://psi.ontopia.net/opera/webpage>. + opera:webpage. website - "Web site"; - <http://psi.ontopia.net/opera/website>. + opera:website. #-- Association Themes @@ -629,14 +645,14 @@ - "de" @iso639-1; - "Tysk" @norwegian; - "deu" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#de>. + lang:de. italian isa language; - "Italian"; - "it" @iso639-1; - "Italiensk" @norwegian; - "ita" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#it>. + lang:it. land-of-verdi isa publisher; - "Land of Verdi"; @@ -644,7 +660,7 @@ local isa network-location; - "Local"; - <http://psi.ontopia.net/opera/local>. + opera:local. lyle-neff isa publisher; - "Lyle K. Neff"; @@ -695,7 +711,7 @@ web isa network-location; - "Web"; - <http://psi.ontopia.net/opera/web>. + opera:web. wikipedia isa publication; - "Wikipedia". @@ -705,7 +721,7 @@ aida isa opera; - "Aida"; - article: <http://en.wikipedia.org/wiki/Aida> @web, wikipedia; + article: wp:Aida @web, wikipedia; audio-recording: "5 56246 2"; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/aida-poster.jpg> @local; libretto: <http://php.indiana.edu/~lneff/libretti/aida.html> @lyle-neff, web; @@ -716,7 +732,7 @@ synopsis: <http://www.azopera.com/learn/synopsis/aida.shtml> @az-opera, web; synopsis: <http://www.metopera.org/synopses/aida.html> @operanews, web; webpage: <http://opera.stanford.edu/opera/Verdi/Aida/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Aida>. + wp:Aida. altname isa nametype; - "Alternative name"; @@ -731,12 +747,12 @@ aroldo isa opera; - "Aroldo"; - article: <http://en.wikipedia.org/wiki/Aroldo> @web, wikipedia; + article: wp:Aroldo @web, wikipedia; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Aroldo.htm>; note: "Time period: 1200 (c.)"; premiere-date: "1857-08-16"; webpage: <http://opera.stanford.edu/opera/Verdi/Aroldo/main.html>; - <http://en.wikipedia.org/wiki/Aroldo>. + wp:Aroldo. bandello isa writer; - "Bandello, Matteo"; @@ -754,7 +770,7 @@ - "Tobia Gorrio" @nom-de-plume, normal; article: <http://localhost:8080/operamap/occurs/snl/boito.htm> @local, snl; article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/boito.htm> @snl, web; - article: <http://en.wikipedia.org/wiki/Arrigo_Boito> @web, wikipedia; + article: wp:Arrigo_Boito @web, wikipedia; biographical-article: <http://localhost:8080/operamap/occurs/librettist/boito.html> @local; date-of-birth: "1842-02-24"; date-of-death: "1918-06-10"; @@ -763,15 +779,15 @@ webpage: <http://www.esdf-opera.de/komponisten/boito/boito-urbesetzungen.htm>; webpage: <http://www.operone.de/komponist/boito.html>; webpage: <http://www.naxos.com/composer/btm.asp?fullname=Boito, Arrigo> @naxos, web; - <http://en.wikipedia.org/wiki/Arrigo_Boito>. + wp:Arrigo_Boito. cause-of-death - "Cause of death"; - "Dødsarsåk" @norwegian; - <http://psi.ontopia.net/biography/cause-of-death>. + bio:cause-of-death. character - "Character"; - "Skikkelse" @norwegian; - <http://psi.ontopia.net/literature/character>. + lit:character. chatterton isa opera; - "Chatterton"; @@ -790,18 +806,18 @@ - "Композитор" @russian; - "Cyfansoddwr" @welsh; - "Komponist" @dutch, german, norwegian; - <http://psi.ontopia.net/music/composer>. + music:composer. container isa superordinate-role-type; - "Container"; - <http://psi.ontopia.net/geography/container>. + geo:container. czech isa language; - "Czech"; - "cs" @iso639-1; - "Tsjekkisk" @norwegian; - "ces" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#cs>. + lang:cs. da-porto isa writer; - "da Porto, Luigi"; @@ -809,7 +825,7 @@ - "da Porto" @short-name; date-of-birth: "1485"; date-of-death: "1529"; - <http://en.wikipedia.org/wiki/Luigi_da_Porto>. + wp:Luigi_da_Porto. dutch isa language; - "Dutch"; @@ -817,7 +833,7 @@ - "dut" @iso639-2b; - "nld" @iso639-2t; - "Nederlandsk" @norwegian; - <http://www.topicmaps.org/xtm/1.0/language.xtm#nl>. + lang:nl. edmea isa opera; - "Edmea"; @@ -831,19 +847,19 @@ - "en" @iso639-1; - "Engelsk" @norwegian; - "eng" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#en>. + lang:en. ernani isa opera; - "Ernani"; - "Il corsaro di Venezia" @altname; - article: <http://en.wikipedia.org/wiki/Ernani> @web, wikipedia; + article: wp:Ernani @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/ernani-score.jpg> @local; libretto: <http://opera.stanford.edu/opera/Verdi/Ernani/libretto.html> @operaglass, web; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Ernani.htm> @italian, land-of-verdi, web; note: "Time period: 1519"; premiere-date: "1844-03-09"; webpage: <http://opera.stanford.edu/opera/Verdi/Ernani/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Ernani>. + wp:Ernani. event - "Historical event"; - "Historisk begivenhet" @norwegian; @@ -868,7 +884,7 @@ - "fi" @iso639-1; - "Finsk" @norwegian; - "fin" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#fi>. + lang:fi. former-name isa nametype; - "Former name"; @@ -881,14 +897,14 @@ - "fre" @iso639-2b; - "fra" @iso639-2t; - "Fransk" @norwegian; - <http://www.topicmaps.org/xtm/1.0/language.xtm#fr>. + lang:fr. german isa language; - "German"; - "de" @iso639-1; - "Tysk" @norwegian; - "deu" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#de>. + lang:de. germania isa opera; - "Germania"; @@ -897,13 +913,13 @@ gianni-schicchi isa opera; - "Gianni Schicchi"; - article: <http://en.wikipedia.org/wiki/Gianni_Schicchi> @web, wikipedia; + article: wp:Gianni_Schicchi @web, wikipedia; audio-recording: "5 56587 2"; illustration: <http://localhost:8080/operamap/occurs/opera/puccini/gianni-schicchi-poster1.jpg> @local; libretto: <http://opera.stanford.edu/opera/Puccini/GianniSchicchi/libretto.html> @operaglass, web; premiere-date: "1918-12-14"; webpage: <http://opera.stanford.edu/opera/Puccini/GianniSchicchi/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Gianni_Schicchi>. + wp:Gianni_Schicchi. giovanna-darco isa opera; - "Giovanna d'Arco"; @@ -919,36 +935,36 @@ guglielmo-ratcliff isa opera; - "Guglielmo Ratcliff"; - article: <http://en.wikipedia.org/wiki/Guglielmo_Ratcliff> @web, wikipedia; + article: wp:Guglielmo_Ratcliff @web, wikipedia; audio-recording: "OPD-1384"; libretto: <http://udel.edu/~dovidl/ratcliff.html> @web; premiere-date: "1895-02-16"; - <http://en.wikipedia.org/wiki/Guglielmo_Ratcliff>. + wp:Guglielmo_Ratcliff. hungarian isa language; - "Hungarian"; - "hu" @iso639-1; - "Ungarsk" @norwegian; - "hun" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#hu>. + lang:hu. i-rantzau isa opera; - "I Rantzau" ("Rantzau" @sort); - article: <http://en.wikipedia.org/wiki/I_Rantzau> @web, wikipedia; + article: wp:I_Rantzau @web, wikipedia; libretto: <http://www.mascagni.org/works/rantzau/excerpts.html> @mascagni.org, web; premiere-date: "1892-11-10"; - <http://en.wikipedia.org/wiki/I_Rantzau>. + wp:I_Rantzau. i-vespri-siciliani isa opera; - "Les Vêpres siciliennes" ("Vepres siciliennes" @sort); - "The Sicilian Vespers" @english ("Sicilian Vespers" @sort); - "I Vespri siciliani" @italian ("Vespri siciliani" @sort); - article: <http://en.wikipedia.org/wiki/Les_vpres_siciliennes> @web, wikipedia; + article: wp:Les_vpres_siciliennes @web, wikipedia; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Vespri_siciliani.htm> @italian, land-of-verdi, web; note: "Time period: 1282"; premiere-date: "1855-06-13"; webpage: <http://opera.stanford.edu/opera/Verdi/Vespri/main.html>; - <http://en.wikipedia.org/wiki/Les_vpres_siciliennes>. + wp:Les_vpres_siciliennes. icelandic isa language; - "Icelandic"; @@ -956,7 +972,7 @@ - "is" @iso639-1; - "ice" @iso639-2b; - "isl" @iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#is>. + lang:is. il-piccolo-marat isa opera; - "Il piccolo Marat" ("Piccolo Marat" @sort); @@ -967,7 +983,7 @@ il-trovatore isa opera; - "Il trovatore" ("Trovatore" @sort); - "The Troubadour" @english ("Troubadour" @sort); - article: <http://en.wikipedia.org/wiki/Il_trovatore> @web, wikipedia; + article: wp:Il_trovatore @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/il-trovatore-poster.jpg> @local; libretto: <http://opera.stanford.edu/opera/Verdi/Trovatore/libretto.html> @operaglass, web; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Trovatore.htm> @italian, land-of-verdi, web; @@ -978,7 +994,7 @@ synopsis: <http://www.metopera.org/synopses/trovator.html> @operanews, web; synopsis: <http://www.opera.it/Operaweb/it/trovatore/trama.html> @italian, operaweb, web; webpage: <http://opera.stanford.edu/opera/Verdi/Trovatore/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Il_trovatore>. + wp:Il_trovatore. iso639-1 isa codetype; - "ISO 639:1988 language code"; @@ -1000,14 +1016,14 @@ - "it" @iso639-1; - "Italiensk" @norwegian; - "ita" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#it>. + lang:it. japanese isa language; - "Japanese"; - "ja" @iso639-1; - "Japansk" @norwegian; - "jpn" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#ja>. + lang:ja. jerusalem-o isa opera; - "Jérusalem" ("Jerusalem" @sort); @@ -1019,19 +1035,19 @@ - "ko" @iso639-1; - "Koreansk" @norwegian; - "kor" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#ko>. + lang:ko. la-battaglia-di-legnano isa opera; - "La battaglia di Legnano" ("Battaglia di Legnano" @sort); - "L'assiedo di Arlem" @altname ("Assiedo di Arlem" @sort); - "La sconfitta degli austriachi" @altname ("Sconfitta degli austriachi" @sort); - article: <http://en.wikipedia.org/wiki/La_battaglia_di_Legnano> @web, wikipedia; + article: wp:La_battaglia_di_Legnano @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/la-battaglia-di-legnano-poster.jpg> @local; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Battaglia_di_Legnano.htm> @italian, land-of-verdi, web; note: "Time period: 1176"; premiere-date: "1849-01-27"; webpage: <http://opera.stanford.edu/opera/Verdi/Legnano/main.html>; - <http://en.wikipedia.org/wiki/La_battaglia_di_Legnano>. + wp:La_battaglia_di_Legnano. la-boheme isa opera; - "La Bohème (Puccini)" ("Boheme (Puccini)" @sort); @@ -1067,7 +1083,7 @@ la-gioconda isa opera; - "La Gioconda" ("Gioconda, La" @sort); - article: <http://en.wikipedia.org/wiki/La_Gioconda> @web, wikipedia; + article: wp:La_Gioconda @web, wikipedia; audio-recording: "5 56291 2"; illustration: <http://localhost:8080/operamap/occurs/opera/ponchielli/la-gioconda-score.jpg> @local; illustration: <http://localhost:8080/operamap/occurs/opera/ponchielli/la-gioconda-score2.jpg> @local; @@ -1077,7 +1093,7 @@ sound-clip: <http://www.ontopia.net/topicmaps/examples/opera/occurs/la-gioconda.wav> @web; synopsis: <http://localhost:8080/operamap/occurs/lg_syn.php3.htm> @az-opera, local; synopsis: <http://www.azopera.com/learn/synopsis/gioconda.shtml> @az-opera, web; - <http://en.wikipedia.org/wiki/La_Gioconda>. + wp:La_Gioconda. la-terra-del-sogno isa opera; - "La Terra del Sogno"; @@ -1101,11 +1117,11 @@ le-villi isa opera; - "Le Villi" ("Villi" @sort); - article: <http://en.wikipedia.org/wiki/Le_Villi> @web, wikipedia; + article: wp:Le_Villi @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/puccini/le-villi-cd1.jpg> @local; libretto: <http://opera.stanford.edu/opera/Puccini/LeVilli/libretto.html> @operaglass, web; premiere-date: "1884-05-31"; - <http://en.wikipedia.org/wiki/Le_Villi>. + wp:Le_Villi. leoncavallo isa composer; - "Leoncavallo, Ruggero"; @@ -1113,7 +1129,7 @@ - "Leoncavallo" @short-name; article: <http://localhost:8080/operamap/occurs/snl/leoncavallo.htm> @local, snl; article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/leoncavallo.htm> @snl, web; - article: <http://en.wikipedia.org/wiki/Ruggero_Leoncavallo> @web, wikipedia; + article: wp:Ruggero_Leoncavallo @web, wikipedia; date-of-birth: "1857-03-08"; date-of-death: "1919-08-09"; illustration: <http://localhost:8080/operamap/occurs/composer/leoncavallo.gif> @local; @@ -1121,7 +1137,7 @@ webpage: <http://www.operone.de/komponist/leoncavallo.html> @web; webpage: <http://www.naxos.com/composer/btm.asp?fullname=Leoncavallo, Ruggiero> @naxos, web; website: <http://www.leoncavallo.ch>; - <http://en.wikipedia.org/wiki/Ruggero_Leoncavallo>. + wp:Ruggero_Leoncavallo. leoni isa composer; - "Leoni, Franco"; @@ -1130,28 +1146,28 @@ - "Leoni" @short-name; - "P. Gournard" @falene, nom-de-plume; - "C. Chewski" @la-terra-del-sogno, nom-de-plume; - article: <http://en.wikipedia.org/wiki/Franco_Leoni> @web, wikipedia; + article: wp:Franco_Leoni @web, wikipedia; date-of-birth: "1864-10-24"; date-of-death: "1949-02-08"; illustration: <http://localhost:8080/operamap/occurs/composer/leoni.jpg> @local; note: "There is some uncertainty about Leoni's date of death. Some sources give 1938-11-11. Also a pupil of Dominiceti."; webpage: <http://opera.stanford.edu/Leoni/main.html>; webpage: <http://www.operone.de/komponist/leoni.html> @web; - <http://en.wikipedia.org/wiki/Franco_Leoni>. + wp:Franco_Leoni. librettist - "Librettist"; guidelines: "A person who has written one or more libretti for an opera. Composers who have written their own libretti do not qualify unless they have written libretti for other composers (like Boito and Leoncavallo)."; - <http://psi.ontopia.net/opera/librettist>. + opera:librettist. luisa-miller isa opera; - "Luisa Miller"; - article: <http://en.wikipedia.org/wiki/Luisa_Miller> @web, wikipedia; + article: wp:Luisa_Miller @web, wikipedia; libretto: <http://php.indiana.edu/~lneff/libretti/Luisa0.html> @lyle-neff, web; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Luisa_Miller.htm> @italian, land-of-verdi, web; note: "Time period: early seventeenth century"; premiere-date: "1849-12-08"; webpage: <http://opera.stanford.edu/opera/Verdi/LuisaMiller/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Luisa_Miller>. + wp:Luisa_Miller. macbeth isa opera; - "Macbeth"; @@ -1194,7 +1210,7 @@ - "Mascagni" @short-name; article: <http://localhost:8080/operamap/occurs/snl/mascagni.htm> @local, snl; article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/mascagni.htm> @snl, web; - article: <http://en.wikipedia.org/wiki/Pietro_Mascagni> @web, wikipedia; + article: wp:Pietro_Mascagni @web, wikipedia; bibref: """Mallach, Alan: "Pietro Mascagni and His Operas", Northeastern University Press (Boston, 2002)"""; date-of-birth: "1863-12-07"; date-of-death: "1945-08-02"; @@ -1204,11 +1220,11 @@ webpage: <http://www.operone.de/komponist/mascagni.html> @web; webpage: <http://www.naxos.com/composer/btm.asp?fullname=Mascagni, Pietro> @naxos, web; website: <http://www.mascagni.org> @mascagni.org, web; - <http://en.wikipedia.org/wiki/Mascagni>. + wp:Mascagni. mefistofele isa opera; - "Mefistofele"; - article: <http://en.wikipedia.org/wiki/Mefistofele> @web, wikipedia; + article: wp:Mefistofele @web, wikipedia; audio-recording: "410 175-2"; descr: "Based on both parts of Goethe's Faust. In naming his setting of Goethe's poem after the devil rather than after its human protagonist, Boito was signalling that his primary concern was the metaphysics of the %22bargain between God and the Devil%22."; illustration: <http://localhost:8080/operamap/occurs/opera/boito/mefistofele-poster1.jpg> @local; @@ -1217,13 +1233,13 @@ synopsis: <http://www.metopera.org/synopses/mefisto.html> @operanews, web; video-recording: "100 414"; webpage: <http://opera.stanford.edu/opera/Boito/Mefistofele/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Mefistofele>. + wp:Mefistofele. nabucco isa opera; - "Nabucco"; - "Nabucodonosor" @altname; - "Nebuchadnezzar" @altname; - article: <http://en.wikipedia.org/wiki/Nabucco> @web, wikipedia; + article: wp:Nabucco @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/nabucco-score.jpg> @local; libretto: <http://opera.stanford.edu/opera/Verdi/Nabucco/libretto.html> @operaglass, web; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Nabucco.htm> @italian, land-of-verdi, web; @@ -1232,7 +1248,7 @@ synopsis: <http://www.metopera.org/synopses/nabucco.html> @operanews, web; synopsis: <http://www.opera.it/Operaweb/it/nabucco/trama.html> @italian, operaweb, web; webpage: <http://opera.stanford.edu/opera/Verdi/Nabucco/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Nabucco>. + wp:Nabucco. nerone2 isa opera; - "Nerone (Mascagni)"; @@ -1260,16 +1276,16 @@ - "no" @iso639-1; - "Norsk" @norwegian; - "nor" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#no>. + lang:no. novel isa artform; - "Novel"; - "Roman" @norwegian; - <http://psi.ontopia.net/literature/novel>. + lit:novel. novella isa artform; - "Novella"; - <http://psi.ontopia.net/literature/novella>. + lit:novella. oberto isa opera; - "Oberto, conte di San Bonifacio"; @@ -1289,7 +1305,7 @@ otello isa opera; - "Otello"; - "Othello" @english; - article: <http://en.wikipedia.org/wiki/Otello> @web, wikipedia; + article: wp:Otello @web, wikipedia; audio-recording: "439 805-2"; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/otello-poster.jpg> @local; libretto: <http://php.indiana.edu/~lneff/libretti/verotel0.html> @lyle-neff, web; @@ -1303,51 +1319,51 @@ synopsis: <http://www.metopera.org/synopses/otello.html> @operanews, web; synopsis: <http://www.opera.it/Operaweb/it/otello/trama.html> @italian, operaweb, web; webpage: <http://opera.stanford.edu/opera/Verdi/Otello/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Otello>. + wp:Otello. pagliacci isa opera; - "Pagliacci"; - article: <http://en.wikipedia.org/wiki/Pagliacci> @web, wikipedia; + article: wp:Pagliacci @web, wikipedia; audio-recording: "74321 50168 2"; libretto: <http://home.earthlink.net/~markdlew/lib/pagliacci/index.htm> @mark-lew, web; premiere-date: "1892-05-21"; synopsis: <http://www.metopera.org/synopses/cavpag.html> @operanews, web; webpage: <http://opera.stanford.edu/opera/Leoncavallo/Pagliacci/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Pagliacci>. + wp:Pagliacci. part - "Part"; - <http://psi.ontopia.net/opera/part>. + opera:part. perpetrator - "Perpetrator"; - <http://psi.ontopia.net/biography/perpetrator>. + bio:perpetrator. person - "Person"; <http://psi.ontopia.net/person>. place - "Place"; - "Sted" @norwegian; - <http://psi.ontopia.net/geography/place>. + geo:place. play isa artform; - "Play"; - "Skuespill" @norwegian; - <http://psi.ontopia.net/literature/play>. + lit:play. poem isa artform; - "Poem"; - "Dikt" @norwegian; - <http://psi.ontopia.net/literature/poem>. + lit:poem. polish isa language; - "Polish"; - "pl" @iso639-1; - "Polsk" @norwegian; - "pol" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#pl>. + lang:pl. publisher - "Publisher"; - "Utgiver" @norwegian; - <http://psi.ontopia.net/literature/publisher>. + lit:publisher. puccini isa composer; - "Puccini, Giacomo"; @@ -1355,7 +1371,7 @@ - "Puccini" @short-name; article: <http://localhost:8080/operamap/occurs/snl/puccini.htm> @local, snl; article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/puccini.htm> @snl, web; - article: <http://en.wikipedia.org/wiki/Giacomo_Puccini> @web, wikipedia; + article: wp:Giacomo_Puccini @web, wikipedia; bibref: """Budden, Julian: "Puccini: His Life and Works", Oxford University Press (Oxford, 2002)"""; bibref: """Sadie, Stanley (ed): "Puccini and His Operas", Macmillan (London, 2000)"""; date-of-birth: "1858-12-22"; @@ -1369,10 +1385,10 @@ webpage: <http://www.r-ds.com/opera/pucciniana/gallery.htm> @r-ds, web; website: <http://www.landofpuccini.com>; website: <http://www.puccini.it> @italian, puccini-study-centre, web; - <http://en.wikipedia.org/wiki/Puccini>. + wp:Puccini. pupil - "Pupil"; - <http://psi.ontopia.net/biography/pupil>. + bio:pupil. real-name isa nametype; - "Real name"; @@ -1384,7 +1400,7 @@ - "Clara di Perth" @altname; - "Lionella" @altname; - "Viscardello" @altname; - article: <http://en.wikipedia.org/wiki/Rigoletto> @web, wikipedia; + article: wp:Rigoletto @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/rigoletto-poster.jpg> @local; libretto: <http://opera.stanford.edu/opera/Verdi/Rigoletto/libretto.html> @operaglass, web; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Rigoletto.htm> @italian, land-of-verdi, web; @@ -1392,30 +1408,30 @@ premiere-date: "1851-03-11"; synopsis: <http://www.metopera.org/synopses/rigoletto.html> @operanews, web; webpage: <http://opera.stanford.edu/opera/Verdi/Rigoletto/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Rigoletto>. + wp:Rigoletto. risurrezione isa opera; - "Risurrezione"; - article: <http://en.wikipedia.org/wiki/Risurrezione> @web, wikipedia; + article: wp:Risurrezione @web, wikipedia; audio-recording: "472 818-2"; audio-recording: "OPD-1399"; premiere-date: "1904-11-30"; webpage: <http://www.delteatro.it/hdoc/result_opera.asp?idopera=1353>; - <http://en.wikipedia.org/wiki/Risurrezione>. + wp:Risurrezione. russian isa language; - "Russian"; - "ru" @iso639-1; - "Russisk" @norwegian; - "rus" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#ru>. + lang:ru. sanskrit isa language; - "Sanskrit"; - "sa" @iso639-1; - "Sanskrit" @norwegian; - "san" @iso639-2b, iso639-2t; - <http://www.topicmaps.org/xtm/1.0/language.xtm#sa>. + lang:sa. short-name isa nametype; - "Short name"; @@ -1438,23 +1454,23 @@ premiere-date: "1895-03-25". source - "Source"; - <http://psi.ontopia.net/opera/source>. + opera:source. style - "Style"; - "Stil" @norwegian; - <http://psi.ontopia.net/opera/style>. + opera:style. supertype isa superordinate-role-type; - "Supertype"; - <http://www.topicmaps.org/xtm/1.0/core.xtm#superclass>. + xtm:superclass. teacher - "Teacher"; - <http://psi.ontopia.net/biography/teacher>. + bio:teacher. un-ballo-in-maschera isa opera; - "Un ballo in maschera" ("Ballo in maschera" @sort); - "A Masked Ball" @english ("Masked Ball" @sort); - article: <http://en.wikipedia.org/wiki/Un_ballo_in_maschera> @web, wikipedia; + article: wp:Un_ballo_in_maschera @web, wikipedia; libretto: <http://php.indiana.edu/~lneff/libretti/Ball0.html> @lyle-neff, web; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Ballo_in_maschera.htm> @italian, land-of-verdi, web; note: """Based-on Scribe's text for Auber's "Gustave III ou Le Bal masqu". There is also a Swedish version: add names."""; @@ -1463,11 +1479,11 @@ synopsis: <http://localhost:8080/operamap/occurs/ubm_syn.php3.htm> @az-opera, local; synopsis: <http://www.azopera.com/learn/synopsis/maschera.shtml> @az-opera, web; webpage: <http://opera.stanford.edu/opera/Verdi/Ballo/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Un_ballo_in_maschera>. + wp:Un_ballo_in_maschera. value - "Value"; - "Verdi" @norwegian; - <http://psi.ontopia.net/metadata/value>. + meta:value. welsh isa language; - "Welsh"; @@ -1475,15 +1491,15 @@ - "wel" @iso639-2b; - "cym" @iso639-2t; - "Walisisk" @norwegian; - <http://www.topicmaps.org/xtm/1.0/language.xtm#cy>. + lang:cy. work - "Work"; - "Verk" @norwegian; - <http://psi.ontopia.net/literature/work>. + lit:work. writer - "Writer"; - "Skribent" @norwegian; - <http://psi.ontopia.net/literature/writer>. + lit:writer. zandonai isa composer; - "Zandonai, Riccardo"; @@ -1509,7 +1525,7 @@ sort - "Sort"; descr: "Suitability for sorting: Suitability of a topic name for use as a sort key; for use in the parameters of variant names."; - <http://www.topicmaps.org/xtm/1.0/core.xtm#sort>. + xtm:sort. @@ -1520,39 +1536,39 @@ Contributor - "Contributor"; - "Bidragsyter" @norwegian; - <http://purl.org/dc/elements/1.1/contributor>. + dc:contributor. Coverage - "Coverage"; - "Dekning" @norwegian; - <http://purl.org/dc/elements/1.1/coverage>. + dc:coverage. HyTM isa Format; - "HyTM"; - <http://psi.ontopia.net/metadata/HyTM>. + meta:HyTM. Identifier - "Identifier"; - "Identifikator" @norwegian; - <http://purl.org/dc/elements/1.1/identifier>. + dc:identifier. LTM isa Format; - "LTM"; - <http://psi.ontopia.net/metadata/LTM>. + meta:LTM. Relation - "Relation"; - "Relasjon" @norwegian; - <http://purl.org/dc/elements/1.1/relation>. + dc:relation. Source - "Source"; - "Kilde" @norwegian; - <http://purl.org/dc/elements/1.1/source>. + dc:source. Title - "Title"; - "Tittel" @norwegian; - <http://purl.org/dc/elements/1.1/title>. + dc:title. XTM isa Format; - "XTM"; - <http://psi.ontopia.net/metadata/XTM>. + meta:XTM. abbe isa character; - "Abbé" ("Abbe" @sort). @@ -1573,7 +1589,7 @@ abreschviller isa city; - "Abreschviller"; - <http://psi.ontopia.net/city/250-abreschviller>. + city:250-abreschviller. acciano isa character; - "Acciano"; @@ -1612,11 +1628,11 @@ adriana-lecouvreur isa opera; - "Adriana Lecouvreur"; - article: <http://en.wikipedia.org/wiki/Adriana_Lecouvreur> @web, wikipedia; + article: wp:Adriana_Lecouvreur @web, wikipedia; audio-recording: "M2K 79310"; illustration: <http://localhost:8080/operamap/occurs/opera/cilea/adriana-lecouvreur-poster.jpg> @local; premiere-date: "1902-11-06"; - <http://en.wikipedia.org/wiki/Adriana_Lecouvreur>. + wp:Adriana_Lecouvreur. adrienne-lecouvreur isa play; - "Adrienne Lecouvreur". @@ -1663,7 +1679,7 @@ aldwort isa city; - "Aldwort"; - <http://psi.ontopia.net/city/826-aldwort>. + city:826-aldwort. alexis isa character; - "Alexis". @@ -1672,7 +1688,7 @@ - "Alfano, Franco"; - "Franco Alfano" @normal; - "Alfano" @short-name; - article: <http://en.wikipedia.org/wiki/Franco_Alfano> @web, wikipedia; + article: wp:Franco_Alfano @web, wikipedia; date-of-birth: "1875-03-08"; date-of-death: "1954-10-27"; illustration: <http://localhost:8080/operamap/occurs/composer/alfano.jpg> @local; @@ -1682,7 +1698,7 @@ webpage: <http://www.operone.de/komponist/alfano.html>; webpage: <http://www.ricordi.com/Compositori/Dettaglio.asp?IdCompositore=28>; webpage: <http://www.rodoni.ch/malipiero/alfanobioingl.html>; - <http://en.wikipedia.org/wiki/Franco_Alfano>. + wp:Franco_Alfano. alfio isa character; - "Alfio"; @@ -1715,13 +1731,13 @@ alzira isa opera; - "Alzira"; - article: <http://en.wikipedia.org/wiki/Alzira> @web, wikipedia; + article: wp:Alzira @web, wikipedia; illustration: <http://localhost:8080/operamap/occurs/opera/verdi/alzira-score.jpg> @local; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Alzira.htm> @italian, land-of-verdi, web; note: "Time period: mid-sixteenth century"; premiere-date: "1845-08-12"; webpage: <http://opera.stanford.edu/opera/Verdi/Alzira/main.html>; - <http://en.wikipedia.org/wiki/Alzira>. + wp:Alzira. alzira-c isa character; - "Alzira (character)"; @@ -1787,14 +1803,14 @@ andrea-chenier isa opera; - "Andrea Chénier" ("Andrea Chenier" @sort); - article: <http://en.wikipedia.org/wiki/Andrea_Chnier> @web, wikipedia; + article: wp:Andrea_Chnier @web, wikipedia; audio-recording: "GD 82046"; premiere-date: "1896-03-28"; synopsis: <http://localhost:8080/operamap/occurs/ac_syn.php3.htm> @az-opera, local; synopsis: <http://www.azopera.com/learn/synopsis/chenier.shtml> @az-opera, web; synopsis: <http://www.metopera.org/synopses/chenier.html> @operanews, web; webpage: <http://opera.stanford.edu/opera/Giordano/AndreaChenier/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Andrea_Chnier>. + wp:Andrea_Chnier. anetiello isa character; - "Anetiello". @@ -1856,7 +1872,7 @@ antioch isa city; - "Antioch"; - <http://psi.ontopia.net/city/792-antioch>. + city:792-antioch. antonio isa character; - "Antonio". @@ -1886,7 +1902,7 @@ argentina isa country; - "Argentina"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#AR>. + country:AR. aria-du-rossignol isa aria; - "Ascolta l'usignuolo!"; @@ -1907,7 +1923,7 @@ arles isa city; - "Arles"; - <http://psi.ontopia.net/city/250-arles>. + city:250-arles. arminio isa character; - "Arminio"; @@ -1953,7 +1969,7 @@ astapovo isa city; - "Astapovo"; - <http://psi.ontopia.net/city/643-astapovo>. + city:643-astapovo. asteria isa character; - "Asteria". @@ -1964,7 +1980,7 @@ athens isa city; - "Athens"; - <http://psi.ontopia.net/city/300-athens>. + city:300-athens. atropo isa character; - "Atropo". @@ -2005,7 +2021,7 @@ austria isa country; - "Austria"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#AT>. + country:AT. azucena isa character; - "Azucena"; @@ -2064,7 +2080,7 @@ baritone isa voice-type; - "Baritone"; - "Bariton" @norwegian; - <http://psi.ontopia.net/music/baritone>. + music:baritone. barnaba isa character; - "Barnaba"; @@ -2089,24 +2105,24 @@ bass isa voice-type; - "Bass" ("Basses" @plural); - <http://psi.ontopia.net/music/bass>. + music:bass. bass-baritone isa voice-type; - "Bass-baritone"; - "Bass-bariton" @norwegian; - <http://psi.ontopia.net/music/bass-baritone>. + music:bass-baritone. bassano isa city; - "Bassano"; - <http://psi.ontopia.net/city/380-bassano>. + city:380-bassano. battering isa cause-of-death; - "Battering"; - <http://psi.ontopia.net/opera/battering>. + opera:battering. bazens isa city; - "Bazens"; - <http://psi.ontopia.net/city/250-bazens>. + city:250-bazens. bazzini isa musician; - "Bazzini, Antonio"; @@ -2114,33 +2130,33 @@ - "Bazzini" @short-name; date-of-birth: "1818-03-11"; date-of-death: "1897-02-10"; - <http://en.wikipedia.org/wiki/Antonio_Bazzini>. + wp:Antonio_Bazzini. beheading isa cause-of-death; - "Beheading"; - <http://psi.ontopia.net/opera/beheading>. + opera:beheading. beijing isa city; - "Beijing"; - "Peking" @former-name; - <http://psi.ontopia.net/city/156-beijing>. + city:156-beijing. belarus isa country; - "Belarus"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#BY>. + country:BY. belasco isa writer; - "Belasco, David"; - "David Belasco" @normal; - "Belasco" @short-name; - article: <http://en.wikipedia.org/wiki/David_Belasco> @web, wikipedia; + article: wp:David_Belasco @web, wikipedia; date-of-birth: "1853-07-25"; date-of-death: "1931-05-15"; - <http://en.wikipedia.org/wiki/David_Belasco>. + wp:David_Belasco. belgium isa country; - "Belgium"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#BE>. + country:BE. bell isa character; - "Bell". @@ -2181,7 +2197,7 @@ berlin isa city; - "Berlin"; - <http://psi.ontopia.net/city/276-berlin>. + city:276-berlin. bernardo-bandini isa character; - "Bernardo Bandini". @@ -2201,7 +2217,7 @@ besancon isa city; - "Besançon"; - <http://psi.ontopia.net/city/250-besancon>. + city:250-besancon. bethune isa character; - "Le Sire de Béthune"; @@ -2257,7 +2273,7 @@ bologna isa city; - "Bologna"; - <http://psi.ontopia.net/city/380-bologna>. + city:380-bologna. bonze isa character; - "The Bonze" ("Bonze" @sort); @@ -2265,7 +2281,7 @@ borgo-san-lorenzo isa city; - "Borgo S. Lorenzo"; - <http://psi.ontopia.net/city/380-borgo-san-lorenzo>. + city:380-borgo-san-lorenzo. borov isa character; - "Borov"; @@ -2277,11 +2293,11 @@ boston isa city; - "Boston"; - <http://psi.ontopia.net/city/840-boston>. + city:840-boston. boulogne-sur-mer isa city; - "Boulogne-sur-Mer"; - <http://psi.ontopia.net/city/250-boulogne-sur-mer>. + city:250-boulogne-sur-mer. bourgeois isa writer; - "Bourgeois, Eugène"; @@ -2298,7 +2314,7 @@ brescia isa city; - "Brescia"; - <http://psi.ontopia.net/city/380-brescia>. + city:380-brescia. bretagne isa region; - "Brittany"; @@ -2317,15 +2333,15 @@ bristol isa city; - "Bristol"; - <http://psi.ontopia.net/city/826-bristol>. + city:826-bristol. brussels isa city; - "Brussels"; - <http://psi.ontopia.net/city/056-brussels>. + city:056-brussels. buenos-aires isa city; - "Buenos Aires"; - <http://psi.ontopia.net/city/032-buenos-aires>. + city:032-buenos-aires. bulwer-lytton isa writer; - "Bulwer-Lytton, Edward"; @@ -2333,11 +2349,11 @@ - "Bulwer-Lytton" @short-name; date-of-birth: "1803-05-25"; date-of-death: "1873-01-18"; - <http://en.wikipedia.org/wiki/Edward_Bulwer-Lytton>. + wp:Edward_Bulwer-Lytton. bury-st-edmunds isa city; - "Bury St. Edmunds"; - <http://psi.ontopia.net/city/826-bury-st-edmunds>. + city:826-bury-st-edmunds. bussy isa character; - "Bussy"; @@ -2354,11 +2370,11 @@ - "Byron" @short-name; date-of-birth: "1788-01-22"; date-of-death: "1824-04-19"; - <http://en.wikipedia.org/wiki/Lord_Byron>. + wp:Lord_Byron. cadiz isa city; - "Cadiz"; - <http://psi.ontopia.net/city/724-cadiz>. + city:724-cadiz. cain isa librettist; - "Cain, Henri"; @@ -2369,7 +2385,7 @@ cairo isa city; - "Cairo"; - <http://psi.ontopia.net/city/818-cairo>. + city:818-cairo. cairo-opera isa theatre; - "Cairo Opera House". @@ -2410,11 +2426,11 @@ capri isa city; - "Capri"; - <http://psi.ontopia.net/city/380-capri>. + city:380-capri. caprino-bergamasco isa city; - "Caprino Bergamasco"; - <http://psi.ontopia.net/city/380-caprino-bergamasco>. + city:380-caprino-bergamasco. captain isa character; - "Naval captain". @@ -2474,7 +2490,7 @@ castelnuovo-scrivia isa city; - "Castelnuovo Scrivia"; - <http://psi.ontopia.net/city/380-castelnuovo-scrivia>. + city:380-castelnuovo-scrivia. castro isa character; - "José Castro"; @@ -2484,7 +2500,7 @@ - "Catalani, Alfredo"; - "Alfredo Catalani" @normal; - "Catalani" @short-name; - article: <http://en.wikipedia.org/wiki/Alfredo_Catalani> @web, wikipedia; + article: wp:Alfredo_Catalani @web, wikipedia; date-of-birth: "1854-06-19"; date-of-death: "1893-08-07"; illustration: <http://localhost:8080/operamap/occurs/composer/catalani.gif> @local; @@ -2492,11 +2508,11 @@ webpage: <http://www.operone.de/komponist/catalani.html>; webpage: <http://www.mynetcologne.de/~nc-ruethjo/Oper/Catalani/catalani.htm> @german, web; webpage: <http://www.naxos.com/composer/btm.asp?fullname=Catalani, Alfredo> @naxos, web; - <http://en.wikipedia.org/wiki/Alfredo_Catalani>. + wp:Alfredo_Catalani. catania isa city; - "Catania"; - <http://psi.ontopia.net/city/380-catania>. + city:380-catania. catarina isa character; - "Catarina Hubscher"; @@ -2521,7 +2537,7 @@ synopsis: <http://www.metopera.org/synopses/cavpag.html> @operanews, web; synopsis: <http://www.opera.it/Operaweb/it/cavalleriarusticana/trama.html> @italian, operaweb, web; webpage: <http://opera.stanford.edu/opera/Mascagni/Cavalleria/main.html> @operaglass, web; - <http://en.wikipedia.org/wiki/Cavalleria_rusticana>. + wp:Cavalleria_rusticana. cavalleria-rusticana-src isa play; - "Cavalleria Rusticana (play)"; @@ -2544,11 +2560,11 @@ ceva isa city; - "Ceva"; - <http://psi.ontopia.net/city/380-ceva>. + city:380-ceva. chantilly isa city; - "Chantilly"; - <http://psi.ontopia.net/city/250-chantilly>. + city:250-chantilly. chatrian isa writer; - "Chatrian, Alexandre"; @@ -2579,14 +2595,14 @@ chicago isa city; - "Chicago"; - <http://psi.ontopia.net/city/840-chicago>. + city:840-chicago. chicago-opera isa theatre; - "Chicago Opera Theater". china isa country; - "China"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#CN>. + country:CN. choudens isa librettist; isa writer; @@ -2613,14 +2629,14 @@ - "Cilea" @short-name; article: <http://localhost:8080/operamap/occurs/snl/cilea.htm> @local, snl; article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/cilea.htm> @snl, web; - article: <http://en.wikipedia.org/wiki/Francesco_Cilea> @web, wikipedia; + article: wp:Francesco_Cilea @web, wikipedia; date-of-birth: "1866-07-23"; date-of-death: "1950-11-20"; illustration: <http://localhost:8080/operamap/occurs/composer/cilea.gif> @local; webpage: <http://www.esdf-opera.de/komponisten/cilea/cilea-urbesetzungen.htm>; webpage: <http://www.operone.de/komponist/cilea.html>; webpage: <http://www.naxos.com/composer/btm.asp?fullname=Cilea, Francesco> @naxos, web; - <http://en.wikipedia.org/wiki/Francesco_Cilea>. + wp:Francesco_Cilea. cim-fen isa character; - "Cim-Fen"; @@ -2686,7 +2702,7 @@ colleretto-parella isa city; - "Colleretto Parella"; - <http://psi.ontopia.net/city/380-colleretto-parella>. + city:380-colleretto-parella. colline isa character; - "Colline"; @@ -2733,7 +2749,7 @@ contralto isa voice-type; - "Contralto"; - "Alt" @norwegian; - <http://psi.ontopia.net/music/contralto>. + music:contralto. coppee isa writer; - "Coppée, François"; @@ -2745,7 +2761,7 @@ cordoba isa city; - "Cordoba"; - <http://psi.ontopia.net/city/724-cordoba>. + city:724-cordoba. corintio isa character; - "Un Corintio". @@ -2759,7 +2775,7 @@ coron isa city; - "Coron"; - <http://psi.ontopia.net/city/300-coron>. + city:300-coron. corrado isa character; - "Corrado"; @@ -2779,7 +2795,7 @@ - "Cossa" @short-name; date-of-birth: "1830"; date-of-death: "1880"; - <http://en.wikipedia.org/wiki/Pietro_Cossa>. + wp:Pietro_Cossa. cossack isa character; - "Cossack". @@ -2823,7 +2839,7 @@ cremona isa city; - "Cremona"; - <http://psi.ontopia.net/city/380-cremona>. + city:380-cremona. creonte isa character; - "Creonte". @@ -2849,7 +2865,7 @@ croatia isa country; - "Croatia"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#HR>. + country:HR. crocifero isa character; - "Crocifero". @@ -2867,19 +2883,19 @@ cyprus isa country; - "Cyprus"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#CY>. + country:CY. cyrano isa character; - "Cyrano". cyrano-de-bergerac isa opera; - "Cyrano de Bergerac"; - article: <http://en.wikipedia.org/wiki/Cyrano_de_Bergerac> @web, wikipedia; + article: wp:Cyrano_de_Bergerac @web, wikipedia; audio-recording: "999 909-2"; note: "Some sources give the date of the first performance as 1936-01-26."; premiere-date: "1936-01-22"; webpage: <http://www.delteatro.it/hdoc/result_opera.asp?idopera=2083>; - <http://en.wikipedia.org/wiki/Cyrano_de_Bergerac>. + wp:Cyrano_de_Bergerac. cyrano-de-bergerac-src isa play; - "Cyrano de Bergerac (play)"; @@ -2887,7 +2903,7 @@ czech-republic isa country; - "Czech Republic"; - <http://www.topicmaps.org/xtm/1.0/country.xtm#CZ>. + country:CZ. dancing-master isa character; - "Dancing master". @@ -2912,7 +2928,7 @@ - "Dante" @short-name; date-of-birth: "1265-05/06"; date-of-death: "1321-09-14"; - <http://en.wikipedia.org/wiki/Dante_Alighieri>. + wp:Dante_Alighieri. dardano isa character; - "Dardano"; @@ -3050,7 +3066,7 @@ display - "Display"; descr: "Suitability for display: Suitability of a topic name for display; for use in the parameters of variant names."; - <http://www.topicmaps.org/xtm/1.0/core.xtm#display>. + xtm:display. distant-voices isa character; - "Two distant voices". @@ -3089,7 +3105,7 @@ don-carlos isa opera; - "Don Carlos"; - "Don Carlo" @altname; - article: <http://en.wikipedia.org/wiki/Don_Carlos> @web, wikipedia; + article: wp:Don_Carlos @web, wikipedia; audio-recording: "7 69304 2"; libretto: <http://www.giuseppeverdi.it/verdi/libretti/Don_Carlo.htm> @italian, land-of-verdi, web; note: "Time period: 1568"; @@ -3098,7 +3114,7 @@ synopsis: <http://www.azopera.com/learn/synopsis/carlo.shtml> @az-opera, web; synopsis: <http://www.metopera.org/synopses/carlo.html> @operanews, web; webpage: <http://opera.stanford.edu/opera/Verdi/DonCarlos/main.html>; - <http://en.wikipedia.org/wiki/Don_Carlos>. + wp:Don_Carlos. don-carlos-c isa character; - "Don Carlos (character)"; @@ -3162,7 +3178,7 @@ - "Dostoyevsky" @short-name;... [truncated message content] |
From: <lh...@us...> - 2009-03-07 10:02:54
|
Revision: 280 http://tinytim.svn.sourceforge.net/tinytim/?rev=280&view=rev Author: lheuer Date: 2009-03-07 10:02:29 +0000 (Sat, 07 Mar 2009) Log Message: ----------- Added converted topic maps Added Paths: ----------- topicmaps/ topicmaps/opera.ctm topicmaps/pokemon.ctm Added: topicmaps/opera.ctm =================================================================== --- topicmaps/opera.ctm (rev 0) +++ topicmaps/opera.ctm 2009-03-07 10:02:29 UTC (rev 280) @@ -0,0 +1,15595 @@ +%encoding "utf-8" +%version 1.0 + +#( +Title: The Italian Opera Topic Map +Author: Steve Pepper, <pe...@on...> + +This version was automatically converted by tinyTiM from the topic map encoded in LTM + +Original copyright notice: + +This topic map may be freely distributed and used for any purpose, +commercial or non-commercial, provided that it is not modified in +any way and that this copyright notice is left intact. + +$Rev:$ - $Date:$ + +Generated by tinyTiM -- http://tinytim.sourceforge.net/ + +)# + +%prefix xsd <http://www.w3.org/2001/XMLSchema#> # Default prefix + + +#-- Topic Map +~ operatm + +operatm - "The Italian Opera Topic Map"; + - "Opera TM" @short-name; + Date: "$Date: 2006/10/27 12:16:15 $"; + Description: "This topic map was originally written to help me understand various aspects of the Topic Maps standard, and to be able to experiment with different modeling approaches. Latterly it has served as a test bed for Ontopia's topic map engine and other components of the Ontopia Knowledge Suite, and therefore contains a number of weird and wonderful constructs (including some bugs we know about, and maybe some we don't!). As of July 2006 it is maintained in LTM syntax. An XTM 1.0 version can be generated using the Export plug-in of the Omnigator."; + Rights: "Copyright (c) 1999-2006, Steve Pepper. This topic map may be freely distributed and used for any purpose, commercial or non-commercial, provided that it is not modified in any way and that this copyright notice is left intact."; + revision: "$Revision: 1.8 $"; + <#--reified--operatm>. + + +#-- ONTOLOGY + + +#-- Topic Types + +Format - "Format"; + <http://purl.org/dc/elements/1.1/format>. + +Type - "Type"; + <http://purl.org/dc/elements/1.1/type>. + +aria isa artform; + - "Aria"; + <http://psi.ontopia.net/music/aria>. + +artform - "Art form"; + - "Kunstart" @norwegian; + <http://psi.ontopia.net/opera/artform>. + +ballet isa artform; + - "Ballet"; + - "Ballett" @norwegian; + <http://psi.ontopia.net/music/ballet>. + +cause-of-death - "Cause of death"; + - "Dødsarsåk" @norwegian; + <http://psi.ontopia.net/biography/cause-of-death>. + +character - "Character"; + - "Skikkelse" @norwegian; + <http://psi.ontopia.net/literature/character>. + +chorus isa artform; + - "Chorus"; + <http://psi.ontopia.net/music/chorus>. + +city - "City" ("Cities" @plural); + - "Ville" @french; + - "Stadt" @german; + - "Città" @italian ("Citta" @sort); + - "By" @norwegian; + <http://psi.ontopia.net/geography/city>. + +codetype - "Code type"; + - "Kodetype" @norwegian; + <http://psi.ontopia.net/basename/codetype>. + +composer - "Composer"; + - "Skladatel" @czech; + - "Säveltäjä" @finnish; + - "Compositeur" @french; + - "Zeneszerző" @hungarian; + - "Tónskáld" @icelandic; + - "Compositore" @italian; + - "作曲家" @japanese; + - "작곡가" @korean; + - "Kompozytor" @polish; + - "Композитор" @russian; + - "Cyfansoddwr" @welsh; + - "Komponist" @dutch, german, norwegian; + <http://psi.ontopia.net/music/composer>. + +conservatory - "Conservatory"; + - "Konservatorium" @norwegian; + <http://psi.ontopia.net/music/conservatory>. + +country - "Country" ("Countries" @plural); + - "Pays" @french; + - "Paese" @italian; + - "Land" @german, norwegian; + <http://psi.ontopia.net/geography/country>. + +dictionary isa artform; + - "Dictionary"; + - "Leksikon" @norwegian; + <http://psi.ontopia.net/literature/dictionary>. + +domain - "Subject domain"; + - "Emneområde" @norwegian; + <http://psi.ontopia.net/domain>. + +event - "Historical event"; + - "Historisk begivenhet" @norwegian; + <http://psi.ontopia.net/history/event>. + +hierarchical-relation-type - "Hierarchical relation type"; + - "Hierarkisk relasjonstype" @norwegian; + <http://www.techquila.com/psi/hierarchy/#hierarchical-relation-type>. + +language - "Language"; + - "Kieli" @finnish; + - "Langue" @french; + - "Sprache" @german; + - "Lingua" @italian; + - "Språk" @norwegian; + <http://psi.ontopia.net/opera/language>. + +librettist - "Librettist"; + guidelines: "A person who has written one or more libretti for an opera. Composers who have written their own libretti do not qualify unless they have written libretti for other composers (like Boito and Leoncavallo)."; + <http://psi.ontopia.net/opera/librettist>. + +metadata - "Metadata"; + <http://psi.ontopia.net/occurrence/metadata>. + +musician - "Musician"; + - "Musiker" @norwegian; + guidelines: "Used in this topic map for people who were teachers of composers but are not themselves classified as composers."; + <http://psi.ontopia.net/music/musician>. + +nameform - "Name form"; + - "Navneform" @norwegian; + <http://psi.ontopia.net/basename/nameform>. + +nametype - "Name type"; + - "Navnetype" @norwegian; + descr: "Used to type short-name, real-name, nom-de-plume, nom-de-guerre, former-name, original-name, altname - and thereby define an axis of scope."; + <http://psi.ontopia.net/basename/name-type>. + +network-location - "Network location"; + <http://psi.ontopia.net/opera/network-location>. + +novel isa artform; + - "Novel"; + - "Roman" @norwegian; + <http://psi.ontopia.net/literature/novel>. + +novella isa artform; + - "Novella"; + <http://psi.ontopia.net/literature/novella>. + +opera isa artform; + - "Opera"; + - "Ooppera" @finnish; + bibref: """Batta, András: "Opera: Composers, Works, Performers", Könemann (Cologne, 1999)"""; + bibref: """Bourne, Joyce: "Who's Who in Opera: A Guide to Opera Characters", Oxford University Press (Oxford, 1998)"""; + bibref: """Boyden, Matthew: "Opera: The Rough Guide", Rough Guides (London, 1999)"""; + bibref: """Freeman, John W.: "Stories of the Great Operas", Norton (New York, 1984)"""; + bibref: """Holden, Amanda (ed): "The New Penguin Opera Guide", Penguin (London, 2002)"""; + bibref: """Keolker, James: "Last Acts : The Operas of Puccini and his Italian Contemporaries", Opera Companion Publications (Napa, 2000)"""; + bibref: """Osborne, Charles: "The Complete Operas of Verdi: A Critical Guide", Gollancz (London, 1969)"""; + bibref: """Pogue, David and Scott Speck: "Opera for Dummies", IDG Books (Foster City, 1997)"""; + bibref: """Rosenthal, Harold and John Warrack: "The Concise Oxford Dictionary of Opera", Oxford University Press (Oxford, 1980)"""; + bibref: """Sadie, Stanley (ed): "The New Grove Book of Operas", Macmillan (London, 1996)"""; + guidelines: <http://localhost:8080/operamap/occurs/opera.htm> @local, ontopus; + guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/opera.htm> @ontopus, web; + webpage: <http://home.prcn.org/~pauld/opera/> @web ~ pauld-website; + website: <http://opera.stanford.edu>; + <http://psi.ontopia.net/music/opera>. + +place - "Place"; + - "Sted" @norwegian; + <http://psi.ontopia.net/geography/place>. + +play isa artform; + - "Play"; + - "Skuespill" @norwegian; + <http://psi.ontopia.net/literature/play>. + +playwright - "Playwright"; + - "Dramatiker" @norwegian; + <http://psi.ontopia.net/literature/playwright>. + +poem isa artform; + - "Poem"; + - "Dikt" @norwegian; + <http://psi.ontopia.net/literature/poem>. + +producer - "Producer"; + - "Produsent" @norwegian; + <http://psi.ontopia.net/opera/producer>. + +publication - "Publication"; + - "Utgivelse" @norwegian; + <http://psi.ontopia.net/literature/publication>. + +publisher - "Publisher"; + - "Utgiver" @norwegian; + <http://psi.ontopia.net/literature/publisher>. + +region - "Region"; + guidelines: <http://localhost:8080/operamap/occurs/region.htm> @local, ontopus; + guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/region.htm> @ontopus, web; + <http://psi.ontopia.net/geography/region>. + +style - "Style"; + - "Stil" @norwegian; + <http://psi.ontopia.net/opera/style>. + +subordinate-role-type - "Subordinate role type"; + <http://www.techquila.com/psi/hierarchy/#subordinate-role-type>. + +superordinate-role-type - "Superordinate role type"; + <http://www.techquila.com/psi/hierarchy/#superordinate-role-type>. + +theatre - "Theatre"; + - "Teater" @norwegian; + <http://psi.ontopia.net/literature/theatre>. + +triptych isa artform; + - "Triptych"; + <http://psi.ontopia.net/music/triptych>. + +tv - "TV company"; + - "TV-selskap" @norwegian; + <http://psi.ontopia.net/opera/tv>. + +voice-type - "Voice type"; + - "Stemmetype" @norwegian; + <http://psi.ontopia.net/music/voice-type>. + +work - "Work"; + - "Verk" @norwegian; + <http://psi.ontopia.net/literature/work>. + +writer - "Writer"; + - "Skribent" @norwegian; + <http://psi.ontopia.net/literature/writer>. + + +#-- Association Types + +Creator - "Creator"; + - "Skaper" @norwegian; + <http://purl.org/dc/elements/1.1/creator>. + +Format - "Format"; + <http://purl.org/dc/elements/1.1/format>. + +Language - "Language"; + <http://purl.org/dc/elements/1.1/language>. + +Publisher - "Publisher"; + - "Utgiver" @norwegian; + <http://purl.org/dc/elements/1.1/publisher>. + +Subject - "Subject(s)"; + - "Tema(er)" @norwegian; + - "Subject of" @value; + - "Tema for" @norwegian, value; + <http://purl.org/dc/elements/1.1/subject>. + +Type - "Type"; + <http://purl.org/dc/elements/1.1/type>. + +appears-in - "Appears in"; + - "Dramatis personae" @work; + <http://psi.ontopia.net/literature/appears-in>. + +based-on - "Based on"; + - "Source of" @source; + <http://psi.ontopia.net/opera/based-on>. + +born-in - "Born in"; + - "Birthplace of" @place; + <http://psi.ontopia.net/biography/born-in>. + +completed-by - "Completed by"; + - "Completed" @composer; + <http://psi.ontopia.net/music/completed-by>. + +composed-by - "Composed by"; + - "Composed" @composer; + <http://psi.ontopia.net/music/composed-by>. + +died-in - "Died in"; + - "Died here" @place; + <http://psi.ontopia.net/biography/died-in>. + +exponent-of - "Exponent of"; + - "Represented by" @style; + <http://psi.ontopia.net/biography/exponent-of>. + +has-voice - "Has voice type"; + <http://psi.ontopia.net/music/has-voice>. + +killed-by - "Killed by"; + - "Kills (by)" @cause-of-death, perpetrator; + <http://psi.ontopia.net/biography/killed-by>. + +libretto-by - "Libretto by"; + - "Wrote libretto for" @librettist; + <http://psi.ontopia.net/literature/libretto-by>. + +located-in isa hierarchical-relation-type; + - "Located in"; + - "Contains" @container; + <http://psi.ontopia.net/geography/located-in>. + +part-of - "Contains"; + - "Part of" @part; + <http://psi.ontopia.net/opera/part-of>. + +premiere - "First performed at"; + - "Hosted première of" @place; + <http://psi.ontopia.net/opera/premiere>. + +published-by - "Published by"; + - "Publisher of" @publisher; + <http://psi.ontopia.net/literature/published-by>. + +pupil-of - "Teacher/pupil"; + - "Pupil of" @pupil; + - "Teacher of" @teacher; + descr: "A relationship between a pupil and his teacher. The Italian Opera Topic Map only includes teachers of composition."; + <http://psi.ontopia.net/biography/pupil-of>. + +revision-of - "Revision of"; + - "Revised as" @source; + <http://psi.ontopia.net/opera/revision-of>. + +subtype-of isa hierarchical-relation-type; + - "Subtype of"; + - "Supertype of" @supertype; + <http://www.topicmaps.org/xtm/1.0/core.xtm#superclass-subclass>. + +sung-by - "Sung by"; + - "Sings" @person; + <http://psi.ontopia.net/music/sung-by>. + +takes-place-during - "Takes place during"; + - "Setting for" @event; + <http://psi.ontopia.net/opera/takes-place-during>. + +takes-place-in - "Takes place in"; + - "Setting for" @place; + <http://psi.ontopia.net/opera/takes-place-in>. + +unfinished - "Unfinished"; + <http://psi.ontopia.net/xtm/association-type/unfinished>. + +written-by - "Written by"; + - "Wrote" @writer; + <http://psi.ontopia.net/literature/written-by>. + + +#-- Role Types + +aria isa artform; + - "Aria"; + <http://psi.ontopia.net/music/aria>. + +cause-of-death - "Cause of death"; + - "Dødsarsåk" @norwegian; + <http://psi.ontopia.net/biography/cause-of-death>. + +character - "Character"; + - "Skikkelse" @norwegian; + <http://psi.ontopia.net/literature/character>. + +composer - "Composer"; + - "Skladatel" @czech; + - "Säveltäjä" @finnish; + - "Compositeur" @french; + - "Zeneszerző" @hungarian; + - "Tónskáld" @icelandic; + - "Compositore" @italian; + - "作曲家" @japanese; + - "작곡가" @korean; + - "Kompozytor" @polish; + - "Композитор" @russian; + - "Cyfansoddwr" @welsh; + - "Komponist" @dutch, german, norwegian; + <http://psi.ontopia.net/music/composer>. + +containee isa subordinate-role-type; + - "Containee"; + <http://psi.ontopia.net/geography/containee>. + +container isa superordinate-role-type; + - "Container"; + <http://psi.ontopia.net/geography/container>. + +event - "Historical event"; + - "Historisk begivenhet" @norwegian; + <http://psi.ontopia.net/history/event>. + +librettist - "Librettist"; + guidelines: "A person who has written one or more libretti for an opera. Composers who have written their own libretti do not qualify unless they have written libretti for other composers (like Boito and Leoncavallo)."; + <http://psi.ontopia.net/opera/librettist>. + +opera isa artform; + - "Opera"; + - "Ooppera" @finnish; + bibref: """Batta, András: "Opera: Composers, Works, Performers", Könemann (Cologne, 1999)"""; + bibref: """Bourne, Joyce: "Who's Who in Opera: A Guide to Opera Characters", Oxford University Press (Oxford, 1998)"""; + bibref: """Boyden, Matthew: "Opera: The Rough Guide", Rough Guides (London, 1999)"""; + bibref: """Freeman, John W.: "Stories of the Great Operas", Norton (New York, 1984)"""; + bibref: """Holden, Amanda (ed): "The New Penguin Opera Guide", Penguin (London, 2002)"""; + bibref: """Keolker, James: "Last Acts : The Operas of Puccini and his Italian Contemporaries", Opera Companion Publications (Napa, 2000)"""; + bibref: """Osborne, Charles: "The Complete Operas of Verdi: A Critical Guide", Gollancz (London, 1969)"""; + bibref: """Pogue, David and Scott Speck: "Opera for Dummies", IDG Books (Foster City, 1997)"""; + bibref: """Rosenthal, Harold and John Warrack: "The Concise Oxford Dictionary of Opera", Oxford University Press (Oxford, 1980)"""; + bibref: """Sadie, Stanley (ed): "The New Grove Book of Operas", Macmillan (London, 1996)"""; + guidelines: <http://localhost:8080/operamap/occurs/opera.htm> @local, ontopus; + guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/opera.htm> @ontopus, web; + webpage: <http://home.prcn.org/~pauld/opera/> @web ~ pauld-website; + website: <http://opera.stanford.edu>; + <http://psi.ontopia.net/music/opera>. + +part - "Part"; + <http://psi.ontopia.net/opera/part>. + +perpetrator - "Perpetrator"; + <http://psi.ontopia.net/biography/perpetrator>. + +person - "Person"; + <http://psi.ontopia.net/person>. + +place - "Place"; + - "Sted" @norwegian; + <http://psi.ontopia.net/geography/place>. + +publisher - "Publisher"; + - "Utgiver" @norwegian; + <http://psi.ontopia.net/literature/publisher>. + +pupil - "Pupil"; + <http://psi.ontopia.net/biography/pupil>. + +resource - "Resource"; + - "Ressurs" @norwegian; + <http://psi.ontopia.net/metadata/resource>. + +result - "Result"; + <http://psi.ontopia.net/opera/result>. + +source - "Source"; + <http://psi.ontopia.net/opera/source>. + +style - "Style"; + - "Stil" @norwegian; + <http://psi.ontopia.net/opera/style>. + +subtype isa subordinate-role-type; + - "Subtype"; + <http://www.topicmaps.org/xtm/1.0/core.xtm#subclass>. + +supertype isa superordinate-role-type; + - "Supertype"; + <http://www.topicmaps.org/xtm/1.0/core.xtm#superclass>. + +teacher - "Teacher"; + <http://psi.ontopia.net/biography/teacher>. + +value - "Value"; + - "Verdi" @norwegian; + <http://psi.ontopia.net/metadata/value>. + +victim - "Victim"; + <http://psi.ontopia.net/biography/victim>. + +voice-type - "Voice type"; + - "Stemmetype" @norwegian; + <http://psi.ontopia.net/music/voice-type>. + +whole - "Whole"; + <http://psi.ontopia.net/opera/whole>. + +work - "Work"; + - "Verk" @norwegian; + <http://psi.ontopia.net/literature/work>. + +writer - "Writer"; + - "Skribent" @norwegian; + <http://psi.ontopia.net/literature/writer>. + + +#-- Occurrence Types + +Date - "Date"; + - "Dato" @norwegian; + <http://purl.org/dc/elements/1.1/date>. + +Description - "Description"; + - "Beskrivelse" @norwegian; + <http://purl.org/dc/elements/1.1/description>. + +Rights - "Rights"; + - "Rettigheter" @norwegian; + <http://purl.org/dc/elements/1.1/rights>. + +article - "Article"; + <http://psi.ontopia.net/opera/article>. + +audio-recording - "Audio recording" ("Recording (audio)" @sort); + descr: "An audio recording. In the Italian Opera topic map this is currently modelled extremely simply as an occurrence whose value is the catalogue number of some recording in the author's collection."; + <http://psi.ontopia.net/music/audio-recording>. + +bibref - "Bibliography"; + <http://psi.ontopia.net/opera/bibref>. + +biographical-article - "Biographical article"; + <http://psi.ontopia.net/biography/biographical-article>. + +date-of-birth isa metadata; + - "Date of birth"; + <http://psi.ontopia.net/biography/date-of-birth>. + +date-of-death isa metadata; + - "Date of death"; + <http://psi.ontopia.net/biography/date-of-death>. + +descr - "Description"; + <http://psi.ontopia.net/occurrence/description>. + +gallery - "Gallery" ("Galleries" @plural); + <http://psi.ontopia.net/opera/gallery>. + +guidelines - "Editorial guidelines"; + <http://psi.ontopia.net/occurrence/editorial-guidelines>. + +illustration - "Illustration"; + <http://psi.ontopia.net/opera/illustration>. + +libretto - "Libretto" ("Libretti" @plural); + <http://psi.ontopia.net/opera/libretto>. + +note isa metadata; + - "Note"; + <http://psi.ontopia.net/opera/note>. + +poster - "Poster"; + <http://psi.ontopia.net/opera/poster>. + +premiere-date isa metadata; + - "Première date"; + <http://psi.ontopia.net/opera/premiere-date>. + +revision - "Revision"; + <http://psi.ontopia.net/xtm/occurrence-type/revision>. + +sound-clip - "Sound clip"; + <http://psi.ontopia.net/music/sound-clip>. + +synopsis - "Synopsis" ("Synopses" @plural); + <http://psi.ontopia.net/opera/synopsis>. + +video-recording - "Video recording" ("Recording (video)" @sort); + descr: "A video recording. In the Italian Opera topic map this is currently modelled extremely simply as an occurrence whose value is the catalogue number of some recording in the author's collection."; + <http://psi.ontopia.net/music/video-recording>. + +webpage - "Web page"; + <http://psi.ontopia.net/opera/webpage>. + +website - "Web site"; + <http://psi.ontopia.net/opera/website>. + + +#-- Association Themes + +la-boheme isa opera; + - "La Bohème (Puccini)" ("Boheme (Puccini)" @sort); + - "La Bohème" @puccini, short-name ("Boheme" @sort); + article: <http://en.wikipedia.org/wiki/La_Boh�me> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/puccini/la-boheme-poster1.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Puccini/LaBoheme/libretto.html> @operaglass, web; + poster: <http://www.r-ds.com/opera/pucciniana/pictures/boheme-score.htm> @r-ds, web; + poster: <http://www.r-ds.com/opera/pucciniana/pictures/boheme_poster.htm> @r-ds, web; + premiere-date: "1896-02-01"; + sound-clip: <http://localhost:8080/operamap/occurs/la-boheme.wav> @local; + sound-clip: <http://www.ontopia.net/topicmaps/examples/opera/occurs/la-boheme.wav> @web; + synopsis: <http://localhost:8080/operamap/occurs/lb_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/boheme.shtml> @az-opera, web; + synopsis: <http://www.metopera.org/synopses/boheme.html> @operanews, web; + video-recording: "100 046"; + webpage: <http://opera.stanford.edu/opera/Puccini/LaBoheme/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/La_Boh%EF%BF%BDme>. + +la-boheme2 isa opera; + - "La Bohème (Leoncavallo)" ("Boheme (Leoncavallo)" @sort); + - "La Bohème" @leoncavallo, short-name ("Boheme" @sort); + article: <http://en.wikipedia.org/wiki/La_Bohme_(Leoncavallo)> @web, wikipedia; + audio-recording: "NE 7300/01"; + premiere-date: "1897-05-06"; + <http://en.wikipedia.org/wiki/La_Bohme_(Leoncavallo)>. + +mascagni.org isa publisher; + - "Mascagni.org"; + webpage: <http://www.mascagni.org>. + +penguin-guide isa publication; + - "New Penguin Opera Guide". + + +#-- Occurrence Themes + +az-opera isa publisher; + - "Arizona Opera"; + webpage: <http://www.azopera.com>. + +german isa language; + - "German"; + - "de" @iso639-1; + - "Tysk" @norwegian; + - "deu" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#de>. + +italian isa language; + - "Italian"; + - "it" @iso639-1; + - "Italiensk" @norwegian; + - "ita" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#it>. + +land-of-verdi isa publisher; + - "Land of Verdi"; + webpage: <http://www.giuseppeverdi.net/ing/index-s.htm>. + +local isa network-location; + - "Local"; + <http://psi.ontopia.net/opera/local>. + +lyle-neff isa publisher; + - "Lyle K. Neff"; + webpage: <http://php.indiana.edu/~lneff/librettim.html>. + +mark-lew isa publisher; + - "Mark D. Lew"; + webpage: <http://home.earthlink.net/~markdlew/lib/>. + +mascagni.org isa publisher; + - "Mascagni.org"; + webpage: <http://www.mascagni.org>. + +naxos isa publisher; + - "Naxos"; + webpage: <http://www.naxos.com>. + +ontopus isa publisher; + - "Ontopus". + +opera-l isa publisher; + - "Opera-l synopsis project"; + webpage: <http://www.orc.soton.ac.uk/ngb/list2.html>. + +operaglass isa publisher; + - "Opera Glass"; + webpage: <http://opera.stanford.edu/opera/>. + +operanews isa publisher; + - "Opera News"; + webpage: <http://www.operanews.com>. + +operaweb isa publisher; + - "Opera Web"; + webpage: <http://www.opera.it/Operaweb/en/home.html>. + +puccini-study-centre isa publisher; + - "Centro studi Giacomo Puccini"; + webpage: <http://www.puccini.it> @italian, puccini-study-centre, web. + +r-ds isa publisher; + - "OperaResource"; + webpage: <http://www.r-ds.com/opera/resource.htm>. + +snl isa publication; + - "Store Norske Leksikon"; + webpage: <http://www.snl.no>. + +web isa network-location; + - "Web"; + <http://psi.ontopia.net/opera/web>. + +wikipedia isa publication; + - "Wikipedia". + + +#-- Name Themes + +aida isa opera; + - "Aida"; + article: <http://en.wikipedia.org/wiki/Aida> @web, wikipedia; + audio-recording: "5 56246 2"; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/aida-poster.jpg> @local; + libretto: <http://php.indiana.edu/~lneff/libretti/aida.html> @lyle-neff, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Aida.htm> @italian, land-of-verdi, web; + note: "Time period: the time of the pharoahs"; + premiere-date: "1871-12-24"; + synopsis: <http://localhost:8080/operamap/occurs/a_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/aida.shtml> @az-opera, web; + synopsis: <http://www.metopera.org/synopses/aida.html> @operanews, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Aida/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Aida>. + +altname isa nametype; + - "Alternative name"; + - "Alternativnavn" @norwegian; + <http://psi.ontopia.net/basename/alternative-name>. + +amica isa opera; + - "Amica"; + illustration: <http://localhost:8080/operamap/occurs/opera/mascagni/amica-poster.jpg> @local; + libretto: <http://www.mascagni.org/works/amica/libretto.html> @mascagni.org, web; + premiere-date: "1905-03-16". + +aroldo isa opera; + - "Aroldo"; + article: <http://en.wikipedia.org/wiki/Aroldo> @web, wikipedia; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Aroldo.htm>; + note: "Time period: 1200 (c.)"; + premiere-date: "1857-08-16"; + webpage: <http://opera.stanford.edu/opera/Verdi/Aroldo/main.html>; + <http://en.wikipedia.org/wiki/Aroldo>. + +bandello isa writer; + - "Bandello, Matteo"; + - "Matteo Bandello" @normal; + - "Bandello" @short-name; + date-of-birth: "1484"; + date-of-death: "1561". + +boito isa composer; + isa librettist; + - "Boïto, Arrigo" ("Boito, Arrigo" @sort); + - "Gorrio, Tobia" @nom-de-plume; + - "Arrigo Boïto" @normal ("Arrigo Boito" @sort); + - "Boito" @short-name; + - "Tobia Gorrio" @nom-de-plume, normal; + article: <http://localhost:8080/operamap/occurs/snl/boito.htm> @local, snl; + article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/boito.htm> @snl, web; + article: <http://en.wikipedia.org/wiki/Arrigo_Boito> @web, wikipedia; + biographical-article: <http://localhost:8080/operamap/occurs/librettist/boito.html> @local; + date-of-birth: "1842-02-24"; + date-of-death: "1918-06-10"; + descr: "Arrigo Boito is probably better known as a librettist than as a composer, especially for his texts for Verdi's Simon Boccanegra, and the Shakespearian Otello and Falstaff, as well as the libretto of Ponchielli's La Gioconda."; + illustration: <http://localhost:8080/operamap/occurs/composer/boito.gif> @local; + webpage: <http://www.esdf-opera.de/komponisten/boito/boito-urbesetzungen.htm>; + webpage: <http://www.operone.de/komponist/boito.html>; + webpage: <http://www.naxos.com/composer/btm.asp?fullname=Boito, Arrigo> @naxos, web; + <http://en.wikipedia.org/wiki/Arrigo_Boito>. + +cause-of-death - "Cause of death"; + - "Dødsarsåk" @norwegian; + <http://psi.ontopia.net/biography/cause-of-death>. + +character - "Character"; + - "Skikkelse" @norwegian; + <http://psi.ontopia.net/literature/character>. + +chatterton isa opera; + - "Chatterton"; + premiere-date: "1896-03-10". + +composer - "Composer"; + - "Skladatel" @czech; + - "Säveltäjä" @finnish; + - "Compositeur" @french; + - "Zeneszerző" @hungarian; + - "Tónskáld" @icelandic; + - "Compositore" @italian; + - "作曲家" @japanese; + - "작곡가" @korean; + - "Kompozytor" @polish; + - "Композитор" @russian; + - "Cyfansoddwr" @welsh; + - "Komponist" @dutch, german, norwegian; + <http://psi.ontopia.net/music/composer>. + +container isa superordinate-role-type; + - "Container"; + <http://psi.ontopia.net/geography/container>. + +czech isa language; + - "Czech"; + - "cs" @iso639-1; + - "Tsjekkisk" @norwegian; + - "ces" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#cs>. + +da-porto isa writer; + - "da Porto, Luigi"; + - "Luigi da Porto" @normal; + - "da Porto" @short-name; + date-of-birth: "1485"; + date-of-death: "1529"; + <http://en.wikipedia.org/wiki/Luigi_da_Porto>. + +dutch isa language; + - "Dutch"; + - "nl" @iso639-1; + - "dut" @iso639-2b; + - "nld" @iso639-2t; + - "Nederlandsk" @norwegian; + <http://www.topicmaps.org/xtm/1.0/language.xtm#nl>. + +edmea isa opera; + - "Edmea"; + libretto: <http://www.mynetcologne.de/~nc-ruethjo/Oper/Catalani/edmea-libretto.htm>; + note: "Time period: 1600"; + premiere-date: "1886-02-27"; + synopsis: <http://www.mynetcologne.de/~nc-ruethjo/Oper/Catalani/edmea-inhalt.htm>. + +english isa language; + - "English"; + - "en" @iso639-1; + - "Engelsk" @norwegian; + - "eng" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#en>. + +ernani isa opera; + - "Ernani"; + - "Il corsaro di Venezia" @altname; + article: <http://en.wikipedia.org/wiki/Ernani> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/ernani-score.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Verdi/Ernani/libretto.html> @operaglass, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Ernani.htm> @italian, land-of-verdi, web; + note: "Time period: 1519"; + premiere-date: "1844-03-09"; + webpage: <http://opera.stanford.edu/opera/Verdi/Ernani/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Ernani>. + +event - "Historical event"; + - "Historisk begivenhet" @norwegian; + <http://psi.ontopia.net/history/event>. + +falene isa opera; + - "Falene"; + premiere-date: "1920". + +falstaff isa opera; + - "Falstaff"; + article: <http://en.wikipedia.org/wiki/Falstaff_(opera)> @web, wikipedia; + libretto: <http://opera.stanford.edu/opera/Verdi/Falstaff/libretto.html> @operaglass, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Falstaff.htm> @italian, land-of-verdi, web; + note: "Time period: reign of Henry IV"; + premiere-date: "1893-02-09"; + webpage: <http://opera.stanford.edu/opera/Verdi/Falstaff/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Falstaff_(opera)>. + +finnish isa language; + - "Finnish"; + - "fi" @iso639-1; + - "Finsk" @norwegian; + - "fin" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#fi>. + +former-name isa nametype; + - "Former name"; + - "Forhenværende navn" @norwegian; + <http://psi.ontopia.net/basename/former-name>. + +french isa language; + - "French"; + - "fr" @iso639-1; + - "fre" @iso639-2b; + - "fra" @iso639-2t; + - "Fransk" @norwegian; + <http://www.topicmaps.org/xtm/1.0/language.xtm#fr>. + +german isa language; + - "German"; + - "de" @iso639-1; + - "Tysk" @norwegian; + - "deu" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#de>. + +germania isa opera; + - "Germania"; + libretto: <http://www.delteatro.it/hdoc/result_opera.asp?idopera=1739>; + premiere-date: "1902-03-11". + +gianni-schicchi isa opera; + - "Gianni Schicchi"; + article: <http://en.wikipedia.org/wiki/Gianni_Schicchi> @web, wikipedia; + audio-recording: "5 56587 2"; + illustration: <http://localhost:8080/operamap/occurs/opera/puccini/gianni-schicchi-poster1.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Puccini/GianniSchicchi/libretto.html> @operaglass, web; + premiere-date: "1918-12-14"; + webpage: <http://opera.stanford.edu/opera/Puccini/GianniSchicchi/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Gianni_Schicchi>. + +giovanna-darco isa opera; + - "Giovanna d'Arco"; + - "Orietta di Lesbo" @altname; + - "Joan of Arc" @english; + article: <http://en.wikipedia.org/wiki/Giovanna_d'Arco> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/giovanna-darco-score.jpg> @local; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Giovanna_Arco.htm> @italian, land-of-verdi, web; + note: "Time period: 1429 (c.)"; + premiere-date: "1845-02-15"; + webpage: <http://opera.stanford.edu/opera/Verdi/Giovanna/main.html>; + <http://en.wikipedia.org/wiki/Giovanna_d'Arco>. + +guglielmo-ratcliff isa opera; + - "Guglielmo Ratcliff"; + article: <http://en.wikipedia.org/wiki/Guglielmo_Ratcliff> @web, wikipedia; + audio-recording: "OPD-1384"; + libretto: <http://udel.edu/~dovidl/ratcliff.html> @web; + premiere-date: "1895-02-16"; + <http://en.wikipedia.org/wiki/Guglielmo_Ratcliff>. + +hungarian isa language; + - "Hungarian"; + - "hu" @iso639-1; + - "Ungarsk" @norwegian; + - "hun" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#hu>. + +i-rantzau isa opera; + - "I Rantzau" ("Rantzau" @sort); + article: <http://en.wikipedia.org/wiki/I_Rantzau> @web, wikipedia; + libretto: <http://www.mascagni.org/works/rantzau/excerpts.html> @mascagni.org, web; + premiere-date: "1892-11-10"; + <http://en.wikipedia.org/wiki/I_Rantzau>. + +i-vespri-siciliani isa opera; + - "Les Vêpres siciliennes" ("Vepres siciliennes" @sort); + - "The Sicilian Vespers" @english ("Sicilian Vespers" @sort); + - "I Vespri siciliani" @italian ("Vespri siciliani" @sort); + article: <http://en.wikipedia.org/wiki/Les_vpres_siciliennes> @web, wikipedia; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Vespri_siciliani.htm> @italian, land-of-verdi, web; + note: "Time period: 1282"; + premiere-date: "1855-06-13"; + webpage: <http://opera.stanford.edu/opera/Verdi/Vespri/main.html>; + <http://en.wikipedia.org/wiki/Les_vpres_siciliennes>. + +icelandic isa language; + - "Icelandic"; + - "Islandsk" @icelandic; + - "is" @iso639-1; + - "ice" @iso639-2b; + - "isl" @iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#is>. + +il-piccolo-marat isa opera; + - "Il piccolo Marat" ("Piccolo Marat" @sort); + audio-recording: "5050466-3246-2-7"; + note: "Time period: 1793 (c.)"; + premiere-date: "1921-05-02". + +il-trovatore isa opera; + - "Il trovatore" ("Trovatore" @sort); + - "The Troubadour" @english ("Troubadour" @sort); + article: <http://en.wikipedia.org/wiki/Il_trovatore> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/il-trovatore-poster.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Verdi/Trovatore/libretto.html> @operaglass, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Trovatore.htm> @italian, land-of-verdi, web; + note: "Time period: fifteenth century"; + premiere-date: "1853-01-19"; + synopsis: <http://localhost:8080/operamap/occurs/it_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/trovatore.shtml> @az-opera, web; + synopsis: <http://www.metopera.org/synopses/trovator.html> @operanews, web; + synopsis: <http://www.opera.it/Operaweb/it/trovatore/trama.html> @italian, operaweb, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Trovatore/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Il_trovatore>. + +iso639-1 isa codetype; + - "ISO 639:1988 language code"; + - "ISO 639 code" @short-name; + <http://psi.ontopia.net/basename/iso639-1>. + +iso639-2b isa codetype; + - "ISO 639-2:1996 Alpha-3 language code (bibliographic)"; + - "ISO 639-2(B) code" @short-name; + <http://psi.ontopia.net/basename/iso639-2b>. + +iso639-2t isa codetype; + - "ISO 639-2:1996 Alpha-3 language code (terminological)"; + - "ISO 639-2(T) code" @short-name; + <http://psi.ontopia.net/basename/iso639-2t>. + +italian isa language; + - "Italian"; + - "it" @iso639-1; + - "Italiensk" @norwegian; + - "ita" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#it>. + +japanese isa language; + - "Japanese"; + - "ja" @iso639-1; + - "Japansk" @norwegian; + - "jpn" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#ja>. + +jerusalem-o isa opera; + - "Jérusalem" ("Jerusalem" @sort); + note: "Time period: 1095-1099"; + premiere-date: "1847-11-26". + +korean isa language; + - "Korean"; + - "ko" @iso639-1; + - "Koreansk" @norwegian; + - "kor" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#ko>. + +la-battaglia-di-legnano isa opera; + - "La battaglia di Legnano" ("Battaglia di Legnano" @sort); + - "L'assiedo di Arlem" @altname ("Assiedo di Arlem" @sort); + - "La sconfitta degli austriachi" @altname ("Sconfitta degli austriachi" @sort); + article: <http://en.wikipedia.org/wiki/La_battaglia_di_Legnano> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/la-battaglia-di-legnano-poster.jpg> @local; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Battaglia_di_Legnano.htm> @italian, land-of-verdi, web; + note: "Time period: 1176"; + premiere-date: "1849-01-27"; + webpage: <http://opera.stanford.edu/opera/Verdi/Legnano/main.html>; + <http://en.wikipedia.org/wiki/La_battaglia_di_Legnano>. + +la-boheme isa opera; + - "La Bohème (Puccini)" ("Boheme (Puccini)" @sort); + - "La Bohème" @puccini, short-name ("Boheme" @sort); + article: <http://en.wikipedia.org/wiki/La_Boh�me> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/puccini/la-boheme-poster1.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Puccini/LaBoheme/libretto.html> @operaglass, web; + poster: <http://www.r-ds.com/opera/pucciniana/pictures/boheme-score.htm> @r-ds, web; + poster: <http://www.r-ds.com/opera/pucciniana/pictures/boheme_poster.htm> @r-ds, web; + premiere-date: "1896-02-01"; + sound-clip: <http://localhost:8080/operamap/occurs/la-boheme.wav> @local; + sound-clip: <http://www.ontopia.net/topicmaps/examples/opera/occurs/la-boheme.wav> @web; + synopsis: <http://localhost:8080/operamap/occurs/lb_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/boheme.shtml> @az-opera, web; + synopsis: <http://www.metopera.org/synopses/boheme.html> @operanews, web; + video-recording: "100 046"; + webpage: <http://opera.stanford.edu/opera/Puccini/LaBoheme/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/La_Boh%EF%BF%BDme>. + +la-boheme2 isa opera; + - "La Bohème (Leoncavallo)" ("Boheme (Leoncavallo)" @sort); + - "La Bohème" @leoncavallo, short-name ("Boheme" @sort); + article: <http://en.wikipedia.org/wiki/La_Bohme_(Leoncavallo)> @web, wikipedia; + audio-recording: "NE 7300/01"; + premiere-date: "1897-05-06"; + <http://en.wikipedia.org/wiki/La_Bohme_(Leoncavallo)>. + +la-falce isa opera; + - "La Falce" ("Falce" @sort); + note: "Time period: 624 A.D., two years after the Hijra (the emigration of Muhammad and his followers to the city of Medina)."; + premiere-date: "1875-07-19"; + synopsis: <http://www.mynetcologne.de/~nc-ruethjo/Oper/Catalani/lafalce-inhalt.htm>. + +la-gioconda isa opera; + - "La Gioconda" ("Gioconda, La" @sort); + article: <http://en.wikipedia.org/wiki/La_Gioconda> @web, wikipedia; + audio-recording: "5 56291 2"; + illustration: <http://localhost:8080/operamap/occurs/opera/ponchielli/la-gioconda-score.jpg> @local; + illustration: <http://localhost:8080/operamap/occurs/opera/ponchielli/la-gioconda-score2.jpg> @local; + libretto: <http://www.karadar.it/Librettos/ponchielli_GIOCONDA.html> @web; + premiere-date: "1876-04-08"; + sound-clip: <http://localhost:8080/operamap/occurs/la-gioconda.wav> @local; + sound-clip: <http://www.ontopia.net/topicmaps/examples/opera/occurs/la-gioconda.wav> @web; + synopsis: <http://localhost:8080/operamap/occurs/lg_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/gioconda.shtml> @az-opera, web; + <http://en.wikipedia.org/wiki/La_Gioconda>. + +la-terra-del-sogno isa opera; + - "La Terra del Sogno"; + premiere-date: "1920-01-10". + +lamico-fritz isa opera; + - "L'amico Fritz" ("Amico Fritz" @sort); + article: <http://en.wikipedia.org/wiki/L'amico_Fritz> @web, wikipedia; + audio-recording: "5 67376 2"; + libretto: <http://www.mascagni.org/works/fritz/excerpts.html> @mascagni.org, web; + premiere-date: "1891-11-01"; + <http://en.wikipedia.org/wiki/L'amico_Fritz>. + +larlesiana isa opera; + - "L'Arlesiana" ("Arlesiana" @sort); + - "The Girl from Arles" @english ("Girl from Arles" @sort); + audio-recording: "476 7644"; + premiere-date: "1897-11-27"; + synopsis: <http://opera.stanford.edu/Cilea/LArlesiana/synopsis.html>; + webpage: <http://opera.stanford.edu/opera/Cilea/LArlesiana/main.html> @operaglass, web. + +le-villi isa opera; + - "Le Villi" ("Villi" @sort); + article: <http://en.wikipedia.org/wiki/Le_Villi> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/puccini/le-villi-cd1.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Puccini/LeVilli/libretto.html> @operaglass, web; + premiere-date: "1884-05-31"; + <http://en.wikipedia.org/wiki/Le_Villi>. + +leoncavallo isa composer; + - "Leoncavallo, Ruggero"; + - "Ruggero Leoncavallo" @normal; + - "Leoncavallo" @short-name; + article: <http://localhost:8080/operamap/occurs/snl/leoncavallo.htm> @local, snl; + article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/leoncavallo.htm> @snl, web; + article: <http://en.wikipedia.org/wiki/Ruggero_Leoncavallo> @web, wikipedia; + date-of-birth: "1857-03-08"; + date-of-death: "1919-08-09"; + illustration: <http://localhost:8080/operamap/occurs/composer/leoncavallo.gif> @local; + webpage: <http://www.esdf-opera.de/komponisten/leoncavallo/leoncavallo-urbesetzungen.htm>; + webpage: <http://www.operone.de/komponist/leoncavallo.html> @web; + webpage: <http://www.naxos.com/composer/btm.asp?fullname=Leoncavallo, Ruggiero> @naxos, web; + website: <http://www.leoncavallo.ch>; + <http://en.wikipedia.org/wiki/Ruggero_Leoncavallo>. + +leoni isa composer; + - "Leoni, Franco"; + - "Frances Lewis" @nom-de-plume; + - "Franco Leoni" @normal; + - "Leoni" @short-name; + - "P. Gournard" @falene, nom-de-plume; + - "C. Chewski" @la-terra-del-sogno, nom-de-plume; + article: <http://en.wikipedia.org/wiki/Franco_Leoni> @web, wikipedia; + date-of-birth: "1864-10-24"; + date-of-death: "1949-02-08"; + illustration: <http://localhost:8080/operamap/occurs/composer/leoni.jpg> @local; + note: "There is some uncertainty about Leoni's date of death. Some sources give 1938-11-11. Also a pupil of Dominiceti."; + webpage: <http://opera.stanford.edu/Leoni/main.html>; + webpage: <http://www.operone.de/komponist/leoni.html> @web; + <http://en.wikipedia.org/wiki/Franco_Leoni>. + +librettist - "Librettist"; + guidelines: "A person who has written one or more libretti for an opera. Composers who have written their own libretti do not qualify unless they have written libretti for other composers (like Boito and Leoncavallo)."; + <http://psi.ontopia.net/opera/librettist>. + +luisa-miller isa opera; + - "Luisa Miller"; + article: <http://en.wikipedia.org/wiki/Luisa_Miller> @web, wikipedia; + libretto: <http://php.indiana.edu/~lneff/libretti/Luisa0.html> @lyle-neff, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Luisa_Miller.htm> @italian, land-of-verdi, web; + note: "Time period: early seventeenth century"; + premiere-date: "1849-12-08"; + webpage: <http://opera.stanford.edu/opera/Verdi/LuisaMiller/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Luisa_Miller>. + +macbeth isa opera; + - "Macbeth"; + article: <http://en.wikipedia.org/wiki/Macbeth_(opera)> @web, wikipedia; + libretto: <http://php.indiana.edu/~lneff/libretti/macbeth.html> @lyle-neff, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Macbeth.htm> @italian, land-of-verdi, web; + note: "Time period: 1040"; + premiere-date: "1847-03-14"; + synopsis: <http://www.orc.soton.ac.uk/ngb/macbeth.html> @opera-l, web; + synopsis: <http://www.metopera.org/synopses/macbeth.html> @operanews, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Macbeth/main.html>; + <http://en.wikipedia.org/wiki/Macbeth_(opera)>. + +madame-sans-gene isa opera; + - "Madame Sans-Gêne" ("Madame Sans-Gene" @sort); + audio-recording: "CDS 247/1-2"; + premiere-date: "1915-01-25". + +manon-lescaut isa opera; + - "Manon Lescaut"; + article: <http://en.wikipedia.org/wiki/Manon_Lescaut_(Puccini)> @web, wikipedia; + audio-recording: "5 56301 2"; + gallery: <http://localhost:8080/operamap/occurs/background-manon_lescaut.htm> @local; + gallery: <http://www.ontopia.net/topicmaps/examples/opera/occurs/background-manon_lescaut.htm> @web; + illustration: <http://localhost:8080/operamap/occurs/opera/puccini/manon-lescaut-score1.jpg> @local; + libretto: <http://www.terra.es/personal/ealmagro/lescaut/acto1.htm>; + poster: <http://www.r-ds.com/opera/pucciniana/pictures/manonl_poster.htm> @r-ds, web; + premiere-date: "1893-02-01"; + synopsis: <http://www.opera.it/Operaweb/it/manonlescaut/trama.html> @italian, operaweb, web; + webpage: <http://www.r-ds.com/opera/pucciniana/manon_lescaut.htm> @r-ds, web; + <http://en.wikipedia.org/wiki/Manon_Lescaut_(Puccini)>. + +marcella isa opera; + - "Marcella"; + premiere-date: "1907-11-09". + +mascagni isa composer; + - "Mascagni, Pietro"; + - "Pietro Mascagni" @normal; + - "Mascagni" @short-name; + article: <http://localhost:8080/operamap/occurs/snl/mascagni.htm> @local, snl; + article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/mascagni.htm> @snl, web; + article: <http://en.wikipedia.org/wiki/Pietro_Mascagni> @web, wikipedia; + bibref: """Mallach, Alan: "Pietro Mascagni and His Operas", Northeastern University Press (Boston, 2002)"""; + date-of-birth: "1863-12-07"; + date-of-death: "1945-08-02"; + illustration: <http://localhost:8080/operamap/occurs/composer/mascagni.gif> @local; + note: "Also a pupil of Michele Saladino."; + webpage: <http://www.esdf-opera.de/komponisten/mascagni/mascagni-urbesetzungen.htm>; + webpage: <http://www.operone.de/komponist/mascagni.html> @web; + webpage: <http://www.naxos.com/composer/btm.asp?fullname=Mascagni, Pietro> @naxos, web; + website: <http://www.mascagni.org> @mascagni.org, web; + <http://en.wikipedia.org/wiki/Mascagni>. + +mefistofele isa opera; + - "Mefistofele"; + article: <http://en.wikipedia.org/wiki/Mefistofele> @web, wikipedia; + audio-recording: "410 175-2"; + descr: "Based on both parts of Goethe's Faust. In naming his setting of Goethe's poem after the devil rather than after its human protagonist, Boito was signalling that his primary concern was the metaphysics of the %22bargain between God and the Devil%22."; + illustration: <http://localhost:8080/operamap/occurs/opera/boito/mefistofele-poster1.jpg> @local; + libretto: <http://php.indiana.edu/~lneff/libretti/MefPro.html> @lyle-neff, web; + premiere-date: "1868-03-05"; + synopsis: <http://www.metopera.org/synopses/mefisto.html> @operanews, web; + video-recording: "100 414"; + webpage: <http://opera.stanford.edu/opera/Boito/Mefistofele/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Mefistofele>. + +nabucco isa opera; + - "Nabucco"; + - "Nabucodonosor" @altname; + - "Nebuchadnezzar" @altname; + article: <http://en.wikipedia.org/wiki/Nabucco> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/nabucco-score.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Verdi/Nabucco/libretto.html> @operaglass, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Nabucco.htm> @italian, land-of-verdi, web; + note: "Time period: 586 B.C."; + premiere-date: "1842-03-09"; + synopsis: <http://www.metopera.org/synopses/nabucco.html> @operanews, web; + synopsis: <http://www.opera.it/Operaweb/it/nabucco/trama.html> @italian, operaweb, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Nabucco/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Nabucco>. + +nerone2 isa opera; + - "Nerone (Mascagni)"; + - "Nerone" @mascagni, short-name; + libretto: <http://www.mascagni.org/works/nerone/excerpts.html> @mascagni.org, web; + premiere-date: "1935-01-16". + +nom-de-guerre isa nametype; + - "Nom de guerre"; + <http://psi.ontopia.net/basename/nom-de-guerre>. + +nom-de-plume isa nametype; + - "Nom de plume"; + guidelines: <http://localhost:8080/operamap/occurs/nom-de-plume.htm> @local, ontopus; + guidelines: <http://www.ontopia.net/topicmaps/examples/opera/occurs/nom-de-plume.htm> @ontopus, web; + <http://psi.ontopia.net/basename/nom-de-plume>. + +normal isa nameform; + - "Normal form"; + - "Normalform" @norwegian; + <http://psi.ontopia.net/basename/normal>. + +norwegian isa language; + - "Norwegian"; + - "no" @iso639-1; + - "Norsk" @norwegian; + - "nor" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#no>. + +novel isa artform; + - "Novel"; + - "Roman" @norwegian; + <http://psi.ontopia.net/literature/novel>. + +novella isa artform; + - "Novella"; + <http://psi.ontopia.net/literature/novella>. + +oberto isa opera; + - "Oberto, conte di San Bonifacio"; + article: <http://en.wikipedia.org/wiki/Oberto_(opera)> @web, wikipedia; + libretto: <http://php.indiana.edu/~lneff/libretti/oberto1.htm> @lyle-neff, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Oberto.htm> @italian, land-of-verdi, web; + note: "Time period: 1228"; + premiere-date: "1839-11-17"; + webpage: <http://opera.stanford.edu/opera/Verdi/Oberto/main.html>; + <http://en.wikipedia.org/wiki/Oberto_(opera)>. + +original-name isa nametype; + - "Original name"; + - "Originalnavn" @norwegian; + <http://psi.ontopia.net/basename/original-name>. + +otello isa opera; + - "Otello"; + - "Othello" @english; + article: <http://en.wikipedia.org/wiki/Otello> @web, wikipedia; + audio-recording: "439 805-2"; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/otello-poster.jpg> @local; + libretto: <http://php.indiana.edu/~lneff/libretti/verotel0.html> @lyle-neff, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Otello.htm> @italian, land-of-verdi, web; + note: "Time period: end of fifteenth century"; + premiere-date: "1887-02-05"; + sound-clip: <http://localhost:8080/operamap/occurs/otello.wav> @local; + sound-clip: <http://www.ontopia.net/topicmaps/examples/opera/occurs/otello.wav> @web; + synopsis: <http://localhost:8080/operamap/occurs/o_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/otello.shtml> @az-opera, web; + synopsis: <http://www.metopera.org/synopses/otello.html> @operanews, web; + synopsis: <http://www.opera.it/Operaweb/it/otello/trama.html> @italian, operaweb, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Otello/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Otello>. + +pagliacci isa opera; + - "Pagliacci"; + article: <http://en.wikipedia.org/wiki/Pagliacci> @web, wikipedia; + audio-recording: "74321 50168 2"; + libretto: <http://home.earthlink.net/~markdlew/lib/pagliacci/index.htm> @mark-lew, web; + premiere-date: "1892-05-21"; + synopsis: <http://www.metopera.org/synopses/cavpag.html> @operanews, web; + webpage: <http://opera.stanford.edu/opera/Leoncavallo/Pagliacci/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Pagliacci>. + +part - "Part"; + <http://psi.ontopia.net/opera/part>. + +perpetrator - "Perpetrator"; + <http://psi.ontopia.net/biography/perpetrator>. + +person - "Person"; + <http://psi.ontopia.net/person>. + +place - "Place"; + - "Sted" @norwegian; + <http://psi.ontopia.net/geography/place>. + +play isa artform; + - "Play"; + - "Skuespill" @norwegian; + <http://psi.ontopia.net/literature/play>. + +poem isa artform; + - "Poem"; + - "Dikt" @norwegian; + <http://psi.ontopia.net/literature/poem>. + +polish isa language; + - "Polish"; + - "pl" @iso639-1; + - "Polsk" @norwegian; + - "pol" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#pl>. + +publisher - "Publisher"; + - "Utgiver" @norwegian; + <http://psi.ontopia.net/literature/publisher>. + +puccini isa composer; + - "Puccini, Giacomo"; + - "Giacomo Puccini" @normal; + - "Puccini" @short-name; + article: <http://localhost:8080/operamap/occurs/snl/puccini.htm> @local, snl; + article: <http://www.ontopia.net/topicmaps/examples/opera/occurs/snl/puccini.htm> @snl, web; + article: <http://en.wikipedia.org/wiki/Giacomo_Puccini> @web, wikipedia; + bibref: """Budden, Julian: "Puccini: His Life and Works", Oxford University Press (Oxford, 2002)"""; + bibref: """Sadie, Stanley (ed): "Puccini and His Operas", Macmillan (London, 2000)"""; + date-of-birth: "1858-12-22"; + date-of-death: "1924-11-29"; + gallery: <http://localhost:8080/operamap/occurs/puccini-gallery.htm> @local; + illustration: <http://localhost:8080/operamap/occurs/composer/puccini.gif> @local; + sound-clip: <http://www.puccini.it/files/vocepucc.wav> @italian, puccini-study-centre, web; + webpage: <http://www.operone.de/komponist/puccini.html> @web; + webpage: <http://localhost:8080/operamap/occurs/hnh-puccini.htm> @local, naxos; + webpage: <http://www.naxos.com/composer/btm.asp?fullname=Puccini, Giacomo> @naxos, web; + webpage: <http://www.r-ds.com/opera/pucciniana/gallery.htm> @r-ds, web; + website: <http://www.landofpuccini.com>; + website: <http://www.puccini.it> @italian, puccini-study-centre, web; + <http://en.wikipedia.org/wiki/Puccini>. + +pupil - "Pupil"; + <http://psi.ontopia.net/biography/pupil>. + +real-name isa nametype; + - "Real name"; + - "Egentlig navn" @norwegian; + <http://psi.ontopia.net/basename/real-name>. + +rigoletto isa opera; + - "Rigoletto"; + - "Clara di Perth" @altname; + - "Lionella" @altname; + - "Viscardello" @altname; + article: <http://en.wikipedia.org/wiki/Rigoletto> @web, wikipedia; + illustration: <http://localhost:8080/operamap/occurs/opera/verdi/rigoletto-poster.jpg> @local; + libretto: <http://opera.stanford.edu/opera/Verdi/Rigoletto/libretto.html> @operaglass, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Rigoletto.htm> @italian, land-of-verdi, web; + note: "Time period: sixteenth century"; + premiere-date: "1851-03-11"; + synopsis: <http://www.metopera.org/synopses/rigoletto.html> @operanews, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Rigoletto/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Rigoletto>. + +risurrezione isa opera; + - "Risurrezione"; + article: <http://en.wikipedia.org/wiki/Risurrezione> @web, wikipedia; + audio-recording: "472 818-2"; + audio-recording: "OPD-1399"; + premiere-date: "1904-11-30"; + webpage: <http://www.delteatro.it/hdoc/result_opera.asp?idopera=1353>; + <http://en.wikipedia.org/wiki/Risurrezione>. + +russian isa language; + - "Russian"; + - "ru" @iso639-1; + - "Russisk" @norwegian; + - "rus" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#ru>. + +sanskrit isa language; + - "Sanskrit"; + - "sa" @iso639-1; + - "Sanskrit" @norwegian; + - "san" @iso639-2b, iso639-2t; + <http://www.topicmaps.org/xtm/1.0/language.xtm#sa>. + +short-name isa nametype; + - "Short name"; + - "Kortnavn" @norwegian; + <http://psi.ontopia.net/basename/short-name>. + +si isa opera; + - "Sì" ("Si" @sort); + note: "Actually an operetta."; + premiere-date: "1919-12-14". + +siberia isa opera; + - "Siberia"; + audio-recording: "CDS 444/1-2"; + premiere-date: "1903-12-19". + +silvano isa opera; + - "Silvano"; + audio-recording: "KC095.1CD"; + premiere-date: "1895-03-25". + +source - "Source"; + <http://psi.ontopia.net/opera/source>. + +style - "Style"; + - "Stil" @norwegian; + <http://psi.ontopia.net/opera/style>. + +supertype isa superordinate-role-type; + - "Supertype"; + <http://www.topicmaps.org/xtm/1.0/core.xtm#superclass>. + +teacher - "Teacher"; + <http://psi.ontopia.net/biography/teacher>. + +un-ballo-in-maschera isa opera; + - "Un ballo in maschera" ("Ballo in maschera" @sort); + - "A Masked Ball" @english ("Masked Ball" @sort); + article: <http://en.wikipedia.org/wiki/Un_ballo_in_maschera> @web, wikipedia; + libretto: <http://php.indiana.edu/~lneff/libretti/Ball0.html> @lyle-neff, web; + libretto: <http://www.giuseppeverdi.it/verdi/libretti/Ballo_in_maschera.htm> @italian, land-of-verdi, web; + note: """Based-on Scribe's text for Auber's "Gustave III ou Le Bal masqu". There is also a Swedish version: add names."""; + note: "Time period: end of the seventeenth century."; + premiere-date: "1859-02-17"; + synopsis: <http://localhost:8080/operamap/occurs/ubm_syn.php3.htm> @az-opera, local; + synopsis: <http://www.azopera.com/learn/synopsis/maschera.shtml> @az-opera, web; + webpage: <http://opera.stanford.edu/opera/Verdi/Ballo/main.html> @operaglass, web; + <http://en.wikipedia.org/wiki/Un_ballo_in_maschera>. + +value - "Value"; + - "Verdi" @norwegian; + <http://psi.ontopia.net/metadata/value>. + +welsh isa language; + - "Welsh"; + - "cy" @iso639-1; + - "wel" @iso639-2b; + - "cym" @iso639-2t; + - "Walisisk" @norwegian; + <http://www.topicmaps.org/xtm/1.0/language.xtm#cy>. + +work - "Work"; + - "Verk" @norwegian; + <http://psi.ontopia.net/literature/work>. + +writer - "Writer"; + - "Skribent" @norwegian; + <http://psi.ontopia.net/literature/writer>. + +zandonai isa composer; + - "Zandonai, Riccardo"; + - "Riccardo Zandonai" @normal; + - "Zandonai" @short-name; + date-of-birth: "1883-05-30"; + date-of-death: "1944-06-05"; + illustration: <http://localhost:8080/operamap/occurs/composer/zandonai.jpg> @local; + webpage: <http://rick.stanford.edu/opera/Zandonai/main.html>; + webpage: <http://www.operone.de/komponist/zandonai.html> @web. + +zaza isa opera; + - "Zazà" ("Zaza" @sort); + audio-recording: "GB 2289/90-2"; + premiere-date: "1900-11-10". + + +#-- Variant Themes + +plural isa nameform; + - "Plural name"; + <http://psi.ontopia.net/xtm/basename/plural>. + +sort - "Sort"; + descr: "Suitability for sorting: Suitability of a topic name for use as a sort key; for use in the parameters of variant names."; + <http://www.topicmaps.org/xtm/1.0/core.xtm#sort>. + + + +#-- INSTANCES + + +#-- Topics + +Contributor - "Contributor"; + - "Bidragsyter" @norwegian; + <http://purl.org/dc/elements/1.1/contributor>. + +Coverage - "Coverage"; + - "Dekning" @norwegian; + <http://purl.org/dc/elements/1.1/coverage>. + +HyTM isa Format; + - "HyTM"; + <http://psi.ontopia.net/metadata/HyTM>. + +Identifier - "Identifier"; + - "Identifikator" @norwegian; + <http://purl.org/dc/elements/1.1/identifier>. + +LTM isa Format; + - "LTM"; + <http://psi.ontopia.net/metadata/LTM>. + +Relation - "Relation"; + - "Relasjon" @norwegian; + <http://purl.org/dc/elements/1.1/relation>. + +Source - "Source"; + - "Kilde" @norwegian; + <http://purl.org/dc/elements/1.1/source>. + +Title - "Title"; + - "Tittel" @norwegian; + <http://purl.org/dc/elements/1.1/title>. + +XTM isa Format; + - "XTM"; + <http://psi.ontopia.net/metadata/XTM>. + +abbe isa character; + - "Abbé" ("Abbe" @sort). + +abbe-of-chazeuil isa character; + - "Abbé de Chazeuil". + +abbess isa character; + - "Abbess". + +abdallo isa character; + - "Abdallo"; + descr: "An elderly officer of the King of Babylon". + +abigaille isa character; + - "Abigaille"; + descr: "A slave, believed to be the eldest daughter of Nabucco". + +abreschviller isa city; + - "Abreschviller"; + <http://psi.ontopia.net/city/250-abreschviller>. + +acciano isa character; + - "Acciano"; + descr: "Tyrant of Antioch". + +ackerman isa librettist; + - "Ackerman, William"; + - "William Ackerman" @normal; + - "Ackerman" @short-name; + date-of-birth: "(unknown)"; + date-of-death: "(unknown)". + +adami isa librettist; + - "Adami, Giuseppe"; + - "Giuseppe Adami" @normal; + - "Adami" @short-name; + biographical-article: <http://localhost:8080/operamap/occurs/librettist/adami.html> @local; + date-of-birth: "1878-11-04"; + date-of-death: "1946-10-12". +... [truncated message content] |
From: <lh...@us...> - 2009-03-06 11:49:47
|
Revision: 279 http://tinytim.svn.sourceforge.net/tinytim/?rev=279&view=rev Author: lheuer Date: 2009-03-06 11:49:34 +0000 (Fri, 06 Mar 2009) Log Message: ----------- - Variant reifier is now part of the output - Java Docs Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-03-05 15:34:47 UTC (rev 278) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-03-06 11:49:34 UTC (rev 279) @@ -62,7 +62,7 @@ * representation. * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public class CTMTopicMapWriter implements TopicMapWriter { @@ -70,11 +70,11 @@ private static final Pattern _ID_PATTERN = Pattern.compile("[A-Za-z_](\\.*[\\-A-Za-z_0-9])*"); private final Writer _out; -// private final String _baseIRI; + private final String _baseIRI; private final String _encoding; private Topic _defaultNameType; //TODO: Add setters/getters - private boolean _exportIIDs = false; + private boolean _exportIIDs = true; private boolean _prettify = true; private String _title; private String _author; @@ -92,20 +92,20 @@ private final Map<Topic, TopicReference> _topic2Reference; - public CTMTopicMapWriter(final OutputStream out) throws IOException { - this(out, "utf-8"); + public CTMTopicMapWriter(final OutputStream out, final String baseIRI) throws IOException { + this(out, baseIRI, "utf-8"); } - public CTMTopicMapWriter(final OutputStream out, final String encoding) throws IOException { - this(new OutputStreamWriter(out, encoding), encoding); + public CTMTopicMapWriter(final OutputStream out, final String baseIRI, final String encoding) throws IOException { + this(new OutputStreamWriter(out, encoding), baseIRI, encoding); } - private CTMTopicMapWriter(final Writer writer, final String encoding) { + private CTMTopicMapWriter(final Writer writer, final String baseIRI, final String encoding) { _out = writer; -// if (baseIRI == null) { -// throw new IllegalArgumentException("The base IRI must not be null"); -// } -// _baseIRI = baseIRI; + if (baseIRI == null) { + throw new IllegalArgumentException("The base IRI must not be null"); + } + _baseIRI = baseIRI; if (encoding == null) { throw new IllegalArgumentException("The encoding must not be null"); } @@ -212,21 +212,10 @@ _newline(); _out.write("%version 1.0"); _writeFileHeader(); - _out.write(")#"); + _out.write("%prefix xsd <" + Namespace.XSD + "> # Default prefix"); _newline(); - _newline(); - _writeSection("Prefixes"); - _out.write("%prefix xsd <" + Namespace.XSD + ">"); - _newline(); Collection<Topic> topics = new ArrayList<Topic>(topicMap.getTopics()); - final boolean removeDefaultNameType = _defaultNameType != null - && _defaultNameType.getSubjectIdentifiers().size() == 1 - && _defaultNameType.getSubjectLocators().size() == 0 - && _defaultNameType.getTypes().size() == 0 - && _defaultNameType.getNames().size() == 0 - && _defaultNameType.getOccurrences().size() == 0 - && _defaultNameType.getRolesPlayed().size() == 0 - && _defaultNameType.getReified() == null; + final boolean removeDefaultNameType = _shouldStandardTopicExported(_defaultNameType); if (removeDefaultNameType) { topics.remove(_defaultNameType); } @@ -273,8 +262,26 @@ _out.write("# Thanks for using tinyTiM -- http://tinytim.sourceforge.net/ :)"); _newline(); _out.flush(); + _topic2Reference.clear(); } + private boolean _shouldStandardTopicExported(Topic topic) { + return topic != null + && topic.getSubjectIdentifiers().size() == 1 + && topic.getSubjectLocators().size() == 0 + && topic.getTypes().size() == 0 + && topic.getNames().size() == 0 + && topic.getOccurrences().size() == 0 + && topic.getRolesPlayed().size() == 0 + && topic.getReified() == null; + } + + /** + * Writes the header comment with the optional title, author, license etc. + * information. + * + * @throws IOException In case of an error. + */ private void _writeFileHeader() throws IOException { _newline(); _newline(); @@ -301,16 +308,19 @@ _out.write("Generated by tinyTiM -- http://tinytim.sourceforge.net/"); _newline(); _newline(); + _out.write(")#"); + _newline(); + _newline(); } /** * If <tt>topics</tt> is not empty, the topics will be removed from * <tt>allTopics</tt> and written out under the specified section <tt>title</tt>. * - * @param topics - * @param allTopics - * @param title - * @throws IOException + * @param topics The topics to serialize. + * @param allTopics A collection of topics where the <tt>topics</tt> should be removed from. + * @param title The title of the ontology section. + * @throws IOException In case of an error. */ private void _writeOntologyTypes(Collection<Topic> topics, Collection<Topic> allTopics, String title) throws IOException { if (topics.isEmpty()) { @@ -322,10 +332,10 @@ } /** - * Sorts the specified collection and serializes the topics. + * Sorts the specified collection of topics and serializes it. * * @param topics An unordered collection of topics. - * @throws IOException If an error occurs. + * @throws IOException In case of an error. */ private void _writeTopics(Collection<Topic> topics) throws IOException { Topic[] topicArray = topics.toArray(new Topic[topics.size()]); @@ -335,15 +345,16 @@ } } + /** + * Serializes a the specified topic. + * + * @param topic The topic to serialize. + * @throws IOException In case of an error. + */ private void _writeTopic(Topic topic) throws IOException { - final TopicReference mainIdentity = _getTopicReference(topic); -// if ((ref.type == TopicReference.ID -// || ref.type == TopicReference.IID) -// && _hasNoCharacteristics(topic)) { -// return; -// } _newline(); boolean wantSemicolon = false; + final TopicReference mainIdentity = _getTopicReference(topic); _writeTopicRef(mainIdentity); _out.write(' '); for (Topic type: topic.getTypes()) { @@ -383,17 +394,10 @@ if (wantSemicolon) { _out.write(' '); } - _out.write("."); + _out.write('.'); _newline(); } -// private boolean _hasNoCharacteristics(Topic topic) { -// return topic.getTypes().isEmpty() -// && topic.getNames().isEmpty() -// && topic.getOccurrences().isEmpty() -// && !(_exportIIDs || topic.getItemIdentifiers().isEmpty()); -// } - private TopicReference[] _getSubjectIdentifiers(Topic topic) { return _getLocators(topic, TopicReference.SID, topic.getSubjectIdentifiers()); } @@ -432,6 +436,12 @@ return refArray; } + /** + * Returns a sorted array of names for the specified topic. + * + * @param topic The topic to retrieve the names from. + * @return A sorted array of names. + */ private Name[] _getNames(Topic topic) { Set<Name> names_ = topic.getNames(); Name[] names = names_.toArray(new Name[names_.size()]); @@ -440,10 +450,10 @@ } /** - * + * Returns a sorted array of occurrences for the specified topic. * - * @param topic - * @return + * @param topic The topic to retrieve the occurrences from. + * @return A sorted array of occurrences. */ private Occurrence[] _getOccurrences(Topic topic) { Set<Occurrence> occs_ = topic.getOccurrences(); @@ -452,6 +462,13 @@ return occs; } + /** + * + * + * @param type + * @param wantSemicolon Indicates if a semicolon should be written. + * @throws IOException In case of an error. + */ private void _writeTypeInstance(Topic type, boolean wantSemicolon) throws IOException { _writeSemicolon(wantSemicolon); _out.write("isa "); @@ -464,6 +481,13 @@ // _writeTopicRef(supertype); // } + /** + * Serializes the specified occurrence. + * + * @param occ The occurrence to serialize + * @param wantSemicolon Indicates if a semicolon should be written. + * @throws IOException In case of an error. + */ private void _writeOccurrence(IOccurrence occ, boolean wantSemicolon) throws IOException { _writeSemicolon(wantSemicolon); _writeTopicRef(occ.getType()); @@ -473,6 +497,13 @@ _writeReifier(occ); } + /** + * Serializes the specified name. + * + * @param name The name to serialize. + * @param wantSemicolon Indicates if a semicolon should be written. + * @throws IOException In case of an error. + */ private void _writeName(IName name, boolean wantSemicolon) throws IOException { _writeSemicolon(wantSemicolon); _out.write("- "); @@ -491,27 +522,45 @@ } } + /** + * Serializes the specified variant. + * + * @param variant The variant to serialize. + * @throws IOException In case of an error. + */ private void _writeVariant(IVariant variant) throws IOException { _out.write(" ("); _writeLiteral(variant.getLiteral()); _writeScope(variant); + _writeReifier(variant); _out.write(')'); } + /** + * Serializes the specified association. + * + * @param assoc The association to serialize. + * @throws IOException In case of an error. + */ private void _writeAssociation(Association assoc) throws IOException { _newline(); _writeTopicRef(assoc.getType()); _out.write('('); Role[] roles = assoc.getRoles().toArray(new Role[0]); Arrays.sort(roles, _roleComparator); + boolean wantComma = false; for (Role role: roles) { + if (wantComma) { + _out.write(", "); + } _writeTopicRef(role.getType()); _out.write(": "); _writeTopicRef(role.getPlayer()); if (role.getReifier() != null) { - _out.write(" #( If you found a reason why a role should be reified, write us )# "); _writeReifier(role); + _out.write(" #( Great, you found a reason why a role should be reified, please tell us about it :) )# "); } + wantComma = true; } _out.write(')'); _writeScope((IScoped) assoc); @@ -519,6 +568,17 @@ _newline(); } + /** + * Writes a semicolon and a newline character iff <tt>wantSemicolon</tt> is + * <tt>true</tt>. + * <p> + * If a semicolon is written, optional whitespaces are written to ident the + * next statement. + * </p> + * + * @param wantSemicolon Indicates if a semicolon should be written. + * @throws IOException In case of an error. + */ private void _writeSemicolon(boolean wantSemicolon) throws IOException { if (wantSemicolon) { _out.write(';'); @@ -530,10 +590,11 @@ } /** - * + * Serializes the scope of the scoped construct if the scope is not + * unconstrained. * - * @param scoped - * @throws IOException + * @param scoped The scoped construct from which the scope should be written. + * @throws IOException In case of an error. */ private void _writeScope(IScoped scoped) throws IOException { IScope scope = scoped.getScopeObject(); @@ -553,19 +614,83 @@ } /** + * Writes the reifier if <tt>reifiable</tt> is reified. + * + * @param reifiable The reifiable construct. + * @throws IOException If an error occurs. + */ + private void _writeReifier(Reifiable reifiable) throws IOException { + Topic reifier = reifiable.getReifier(); + if (reifier == null) { + return; + } + _out.write(" ~ "); + _writeTopicRef(reifier); + } + + /** + * Writes a literal. * + * If the datatype is xsd:anyURI or xsd:string, the datatype is omitted. + * If the datatype is natively supported by CTM (like xsd:integer, xsd:decimal) + * the quotes and the datatype are omitted. * + * @param lit The literal to serialize. + * @throws IOException In case of an error. + */ + private void _writeLiteral(ILiteral lit) throws IOException { + final Locator datatype = lit.getDatatype(); + final String value = lit.getValue(); + if (XSD.ANY_URI.equals(datatype)) { + _writeLocator(value); + } + else if (XSD.STRING.equals(datatype)) { + _writeString(value); + } + else if (_isNativelySupported(lit)) { + _out.write(value); + } + else { + _writeString(value); + _out.write("^^"); + String datatypeIRI = datatype.toExternalForm(); + if (datatypeIRI.startsWith(Namespace.XSD)) { + _out.write("xsd:"); + _out.write(datatypeIRI.substring(datatypeIRI.lastIndexOf('#')+1)); + } + else { + _writeLocator(datatypeIRI); + } + } + } + + /** + * + * * @param topic - * @throws IOException + * @throws IOException In case of an error. */ private void _writeTopicRef(Topic topic) throws IOException { _writeTopicRef(_getTopicReference(topic)); } + /** + * + * + * @param topicRef + * @throws IOException In case of an error. + */ private void _writeTopicRef(TopicReference topicRef) throws IOException { _writeTopicRef(topicRef, false); } + /** + * + * + * @param topicRef + * @param wantSemicolon Indicates if a semicolon should be written. + * @throws IOException In case of an error. + */ private void _writeTopicRef(TopicReference topicRef, boolean wantSemicolon) throws IOException { _writeSemicolon(wantSemicolon); switch (topicRef.type) { @@ -586,10 +711,24 @@ _writeLocator(topicRef.reference); } + /** + * + * + * @param string + * @throws IOException + */ private void _writeString(String string) throws IOException { - //TODO: Escape _out.write('"'); - _out.write(string); + char[] ch = string.toCharArray(); + for (int i=0; i<ch.length; i++) { + switch (ch[i]) { + case '"': + case '\\': + _out.write("\\"); + default: + _out.write(ch[i]); + } + } _out.write('"'); } @@ -614,7 +753,7 @@ if (ref == null) { if (topic.getItemIdentifiers().size() == 1) { final String iid = topic.getItemIdentifiers().iterator().next().toExternalForm(); - int idx = iid.lastIndexOf('#'); + int idx = !iid.startsWith(_baseIRI) ? -1 : iid.lastIndexOf('#'); if (idx > 0) { String id = iid.substring(idx + 1); ref = _isValidId(id) ? TopicReference.createId(id) @@ -652,42 +791,6 @@ return _ID_PATTERN.matcher(id).matches(); } - /** - * Writes a literal. - * - * If the datatype is xsd:anyURI or xsd:string, the datatype is omitted. - * If the datatype is natively supported by CTM (like xsd:integer, xsd:decimal) - * the quotes and the datatype are omitted. - * - * @param lit The literal to serialize. - * @throws IOException In case of an error. - */ - private void _writeLiteral(ILiteral lit) throws IOException { - final Locator datatype = lit.getDatatype(); - final String value = lit.getValue(); - if (XSD.ANY_URI.equals(datatype)) { - _writeLocator(value); - } - else if (!XSD.STRING.equals(datatype) - && _isNativelySupported(lit)) { - _out.write(value); - } - else { - _writeString(value); - if (!XSD.STRING.equals(datatype)) { - _out.write("^^"); - String datatypeIRI = datatype.toExternalForm(); - if (datatypeIRI.startsWith(Namespace.XSD)) { - _out.write("xsd:"); - _out.write(datatypeIRI.substring(datatypeIRI.lastIndexOf('#')+1)); - } - else { - _writeLocator(datatypeIRI); - } - } - } - } - private boolean _isNativelySupported(ILiteral literal) { Locator datatype = literal.getDatatype(); return XSD.STRING.equals(datatype) @@ -701,21 +804,6 @@ || "-INF".equals(literal.getValue())); } - /** - * Writes the reifier if <tt>reifiable</tt> is reified. - * - * @param reifiable The reifiable construct. - * @throws IOException If an error occurs. - */ - private void _writeReifier(Reifiable reifiable) throws IOException { - Topic reifier = reifiable.getReifier(); - if (reifier == null) { - return; - } - _out.write(" ~ "); - _writeTopicRef(reifier); - } - private void _newline() throws IOException { _out.write('\n'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-05 15:34:57
|
Revision: 278 http://tinytim.svn.sourceforge.net/tinytim/?rev=278&view=rev Author: lheuer Date: 2009-03-05 15:34:47 +0000 (Thu, 05 Mar 2009) Log Message: ----------- Added experimental CTM topic map serializer Added Paths: ----------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java Added: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java (rev 0) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java 2009-03-05 15:34:47 UTC (rev 278) @@ -0,0 +1,1193 @@ +/* + * Copyright 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.mio; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.logging.Logger; +import java.util.regex.Pattern; + +import org.tinytim.internal.api.IIndexManagerAware; +import org.tinytim.internal.api.ILiteral; +import org.tinytim.internal.api.ILiteralAware; +import org.tinytim.internal.api.IName; +import org.tinytim.internal.api.IOccurrence; +import org.tinytim.internal.api.IScope; +import org.tinytim.internal.api.IScoped; +import org.tinytim.internal.api.IVariant; +import org.tinytim.voc.Namespace; +import org.tinytim.voc.TMDM; +import org.tinytim.voc.XSD; + +import org.tmapi.core.Association; +import org.tmapi.core.DatatypeAware; +import org.tmapi.core.Locator; +import org.tmapi.core.Name; +import org.tmapi.core.Occurrence; +import org.tmapi.core.Reifiable; +import org.tmapi.core.Role; +import org.tmapi.core.Scoped; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; +import org.tmapi.core.Typed; +import org.tmapi.core.Variant; +import org.tmapi.index.TypeInstanceIndex; + +/** + * {@link TopicMapWriter} implementation that is able to serialize topic maps + * into a + * <a href="http://www.isotopicmaps.org/ctm/">Compact Topic Maps (CTM) 1.0</a> + * representation. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class CTMTopicMapWriter implements TopicMapWriter { + + private static final Logger LOG = Logger.getLogger(CTMTopicMapWriter.class.getName()); + + private static final Pattern _ID_PATTERN = Pattern.compile("[A-Za-z_](\\.*[\\-A-Za-z_0-9])*"); + private final Writer _out; +// private final String _baseIRI; + private final String _encoding; + private Topic _defaultNameType; + //TODO: Add setters/getters + private boolean _exportIIDs = false; + private boolean _prettify = true; + private String _title; + private String _author; + private String _license; + private String _comment; + private final Comparator<Topic> _topicComparator; + private final Comparator<Association> _assocComparator; + private final Comparator<Occurrence> _occComparator; + private final Comparator<Name> _nameComparator; + private final Comparator<Set<Topic>> _scopeComparator; + private final Comparator<Locator> _locComparator; + private final Comparator<Set<Locator>> _locSetComparator; + private final Comparator<Role> _roleComparator; + private final Comparator<Variant> _variantComparator; + private final Map<Topic, TopicReference> _topic2Reference; + + + public CTMTopicMapWriter(final OutputStream out) throws IOException { + this(out, "utf-8"); + } + + public CTMTopicMapWriter(final OutputStream out, final String encoding) throws IOException { + this(new OutputStreamWriter(out, encoding), encoding); + } + + private CTMTopicMapWriter(final Writer writer, final String encoding) { + _out = writer; +// if (baseIRI == null) { +// throw new IllegalArgumentException("The base IRI must not be null"); +// } +// _baseIRI = baseIRI; + if (encoding == null) { + throw new IllegalArgumentException("The encoding must not be null"); + } + _encoding = encoding; + _topic2Reference = new HashMap<Topic, TopicReference>(200); + _scopeComparator = new ScopeComparator(); + _locSetComparator = new LocatorSetComparator(); + _locComparator = new LocatorComparator(); + _topicComparator = new TopicComparator(); + _assocComparator = new AssociationComparator(); + _occComparator = new OccurrenceComparator(); + _nameComparator = new NameComparator(); + _roleComparator = new RoleComparator(); + _variantComparator = new VariantComparator(); + } + + /** + * Sets the title of the topic map which appears at the top of the file. + * + * @param title The title of the topic map. + */ + public void setTitle(String title) { + _title = title; + } + + /** + * Returns the title of the topic map. + * + * @return The title or <tt>null</tt> if no title was set. + */ + public String getTitle() { + return _title; + } + + /** + * Sets the author which appears at the top of the file. + * + * @param author The author. + */ + public void setAuthor(String author) { + _author = author; + } + + /** + * Returns the author. + * + * @return The author or <tt>null</tt> if no author was set. + */ + public String getAuthor() { + return _author; + } + + /** + * Sets the license which should appear on top of the file. + * <p> + * The license of the topic map. This could be a name or an IRI or both, i.e. + * "Creative Commons-License <http://creativecommons.org/licenses/by-nc-sa/3.0/>". + * </p> + * + * @param license The license. + */ + public void setLicense(String license) { + _license = license; + } + + /** + * Returns the license. + * + * @return The license or <tt>null</tt> if no license was set. + */ + public String getLicense() { + return _license; + } + + /** + * Sets a file comment. + * <p> + * The comment could describe the topic map, or provide an additional + * copyright notice, or SVN/CVS keywords etc. + * </p> + * + * @param comment The comment. + */ + public void setComment(String comment) { + _comment = comment; + } + + /** + * Returns the comment. + * + * @return The comment or <tt>null</tt> if no comment was set. + */ + public String getComment() { + return _comment; + } + + /* (non-Javadoc) + * @see org.tinytim.mio.TopicMapWriter#write(org.tmapi.core.TopicMap) + */ + @Override + public void write(TopicMap topicMap) throws IOException { + _defaultNameType = topicMap.getTopicBySubjectIdentifier(TMDM.TOPIC_NAME); + _out.write("%encoding \"" + _encoding + "\""); + _newline(); + _out.write("%version 1.0"); + _writeFileHeader(); + _out.write(")#"); + _newline(); + _newline(); + _writeSection("Prefixes"); + _out.write("%prefix xsd <" + Namespace.XSD + ">"); + _newline(); + Collection<Topic> topics = new ArrayList<Topic>(topicMap.getTopics()); + final boolean removeDefaultNameType = _defaultNameType != null + && _defaultNameType.getSubjectIdentifiers().size() == 1 + && _defaultNameType.getSubjectLocators().size() == 0 + && _defaultNameType.getTypes().size() == 0 + && _defaultNameType.getNames().size() == 0 + && _defaultNameType.getOccurrences().size() == 0 + && _defaultNameType.getRolesPlayed().size() == 0 + && _defaultNameType.getReified() == null; + if (removeDefaultNameType) { + topics.remove(_defaultNameType); + } + if (topicMap.getReifier() != null) { + // Special handling of the tm reifier to avoid an additional + // whitespace character in front of the ~ + Topic reifier = topicMap.getReifier(); + _writeSection("Topic Map"); + _out.write("~ "); + _writeTopicRef(reifier); + _newline(); + _writeTopic(reifier); + topics.remove(reifier); + } + TypeInstanceIndex tiIdx = ((IIndexManagerAware) topicMap).getIndexManager().getTypeInstanceIndex(); + if (!tiIdx.isAutoUpdated()) { + tiIdx.reindex(); + } + _writeSection("ONTOLOGY"); + _writeOntologyTypes(tiIdx.getTopicTypes(), topics, "Topic Types"); + _writeOntologyTypes(tiIdx.getAssociationTypes(), topics, "Association Types"); + _writeOntologyTypes(tiIdx.getRoleTypes(), topics, "Role Types"); + _writeOntologyTypes(tiIdx.getOccurrenceTypes(), topics, "Occurrence Types"); + Collection<Topic> nameTypes = new ArrayList<Topic>(tiIdx.getNameTypes()); + if (removeDefaultNameType) { + nameTypes.remove(_defaultNameType); + } + _writeOntologyTypes(nameTypes, topics, "Name Types"); + tiIdx.close(); + _newline(); + _writeSection("INSTANCES"); + _writeSection("Topics"); + _writeTopics(topics); + Collection<Association> assocs = new ArrayList<Association>(topicMap.getAssociations()); + if (!assocs.isEmpty()) { + Association[] assocArray = assocs.toArray(new Association[assocs.size()]); + _writeSection("Associations"); + Arrays.sort(assocArray, _assocComparator); + for (Association assoc: assocArray) { + _writeAssociation(assoc); + } + } + _newline(); + _out.write("# Thanks for using tinyTiM -- http://tinytim.sourceforge.net/ :)"); + _newline(); + _out.flush(); + } + + private void _writeFileHeader() throws IOException { + _newline(); + _newline(); + _out.write("#("); + _newline(); + if (_title != null) { + _out.write("Title: " + _title); + _newline(); + } + if (_author != null) { + _out.write("Author: " + _author); + _newline(); + } + if (_license != null) { + _out.write("License: " + _license); + _newline(); + } + if (_comment != null) { + _newline(); + _out.write(_comment); + _newline(); + } + _newline(); + _out.write("Generated by tinyTiM -- http://tinytim.sourceforge.net/"); + _newline(); + _newline(); + } + + /** + * If <tt>topics</tt> is not empty, the topics will be removed from + * <tt>allTopics</tt> and written out under the specified section <tt>title</tt>. + * + * @param topics + * @param allTopics + * @param title + * @throws IOException + */ + private void _writeOntologyTypes(Collection<Topic> topics, Collection<Topic> allTopics, String title) throws IOException { + if (topics.isEmpty()) { + return; + } + allTopics.removeAll(topics); + _writeSection(title); + _writeTopics(topics); + } + + /** + * Sorts the specified collection and serializes the topics. + * + * @param topics An unordered collection of topics. + * @throws IOException If an error occurs. + */ + private void _writeTopics(Collection<Topic> topics) throws IOException { + Topic[] topicArray = topics.toArray(new Topic[topics.size()]); + Arrays.sort(topicArray, _topicComparator); + for (Topic topic: topicArray) { + _writeTopic(topic); + } + } + + private void _writeTopic(Topic topic) throws IOException { + final TopicReference mainIdentity = _getTopicReference(topic); +// if ((ref.type == TopicReference.ID +// || ref.type == TopicReference.IID) +// && _hasNoCharacteristics(topic)) { +// return; +// } + _newline(); + boolean wantSemicolon = false; + _writeTopicRef(mainIdentity); + _out.write(' '); + for (Topic type: topic.getTypes()) { + _writeTypeInstance(type, wantSemicolon); + wantSemicolon = true; + } + for (Name name: _getNames(topic)) { + _writeName((IName) name, wantSemicolon); + wantSemicolon = true; + } + for (Occurrence occ: _getOccurrences(topic)) { + _writeOccurrence((IOccurrence) occ, wantSemicolon); + wantSemicolon = true; + } + for (TopicReference sid: _getSubjectIdentifiers(topic)) { + _writeTopicRef(sid, wantSemicolon); + wantSemicolon = true; + } + for (TopicReference slo: _getSubjectLocators(topic)) { + _writeTopicRef(slo, wantSemicolon); + wantSemicolon = true; + } + if (_exportIIDs) { + TopicReference[] iids = _getItemIdentifiers(topic); + if ((mainIdentity.type == TopicReference.ID + || mainIdentity.type == TopicReference.IID) + && iids.length == 1) { + //TODO + } + else { + for (TopicReference iid: iids) { + _writeTopicRef(iid, wantSemicolon); + wantSemicolon = true; + } + } + } + if (wantSemicolon) { + _out.write(' '); + } + _out.write("."); + _newline(); + } + +// private boolean _hasNoCharacteristics(Topic topic) { +// return topic.getTypes().isEmpty() +// && topic.getNames().isEmpty() +// && topic.getOccurrences().isEmpty() +// && !(_exportIIDs || topic.getItemIdentifiers().isEmpty()); +// } + + private TopicReference[] _getSubjectIdentifiers(Topic topic) { + return _getLocators(topic, TopicReference.SID, topic.getSubjectIdentifiers()); + } + + private TopicReference[] _getSubjectLocators(Topic topic) { + return _getLocators(topic, TopicReference.SLO, topic.getSubjectLocators()); + } + + private TopicReference[] _getItemIdentifiers(Topic topic) { + return _getLocators(topic, TopicReference.IID, topic.getItemIdentifiers()); + } + + private TopicReference[] _getLocators(Topic topic, int kind, Set<Locator> locs) { + if (locs.isEmpty()) { + return new TopicReference[0]; + } + Collection<TopicReference> refs = new ArrayList<TopicReference>(locs.size()); + if (kind == TopicReference.SID) { + for (Locator loc: locs) { + refs.add(TopicReference.createSubjectIdentifier(loc.toExternalForm())); + } + } + else if (kind == TopicReference.IID) { + for (Locator loc: locs) { + refs.add(TopicReference.createItemIdentifier(loc.toExternalForm())); + } + } + else if (kind == TopicReference.SLO) { + for (Locator loc: locs) { + refs.add(TopicReference.createSubjectLocator(loc.toExternalForm())); + } + } + refs.remove(_getTopicReference(topic)); + TopicReference[] refArray = refs.toArray(new TopicReference[refs.size()]); + //Arrays.sort(locArray, _locComparator); + return refArray; + } + + private Name[] _getNames(Topic topic) { + Set<Name> names_ = topic.getNames(); + Name[] names = names_.toArray(new Name[names_.size()]); + Arrays.sort(names, _nameComparator); + return names; + } + + /** + * + * + * @param topic + * @return + */ + private Occurrence[] _getOccurrences(Topic topic) { + Set<Occurrence> occs_ = topic.getOccurrences(); + Occurrence[] occs = occs_.toArray(new Occurrence[occs_.size()]); + Arrays.sort(occs, _occComparator); + return occs; + } + + private void _writeTypeInstance(Topic type, boolean wantSemicolon) throws IOException { + _writeSemicolon(wantSemicolon); + _out.write("isa "); + _writeTopicRef(type); + } + +// private void _writeSupertypeSubtype(Topic supertype, boolean wantSemicolon) throws IOException { +// _writeSemicolon(wantSemicolon); +// _out.write("ako "); +// _writeTopicRef(supertype); +// } + + private void _writeOccurrence(IOccurrence occ, boolean wantSemicolon) throws IOException { + _writeSemicolon(wantSemicolon); + _writeTopicRef(occ.getType()); + _out.write(": "); + _writeLiteral(occ.getLiteral()); + _writeScope(occ); + _writeReifier(occ); + } + + private void _writeName(IName name, boolean wantSemicolon) throws IOException { + _writeSemicolon(wantSemicolon); + _out.write("- "); + Topic type = name.getType(); + if (!type.equals(_defaultNameType)) { + _writeTopicRef(type); + _out.write(": "); + } + _writeString(name.getValue()); + _writeScope(name); + _writeReifier(name); + Variant[] variants = name.getVariants().toArray(new Variant[0]); + Arrays.sort(variants, _variantComparator); + for (Variant variant: variants) { + _writeVariant((IVariant) variant); + } + } + + private void _writeVariant(IVariant variant) throws IOException { + _out.write(" ("); + _writeLiteral(variant.getLiteral()); + _writeScope(variant); + _out.write(')'); + } + + private void _writeAssociation(Association assoc) throws IOException { + _newline(); + _writeTopicRef(assoc.getType()); + _out.write('('); + Role[] roles = assoc.getRoles().toArray(new Role[0]); + Arrays.sort(roles, _roleComparator); + for (Role role: roles) { + _writeTopicRef(role.getType()); + _out.write(": "); + _writeTopicRef(role.getPlayer()); + if (role.getReifier() != null) { + _out.write(" #( If you found a reason why a role should be reified, write us )# "); + _writeReifier(role); + } + } + _out.write(')'); + _writeScope((IScoped) assoc); + _writeReifier(assoc); + _newline(); + } + + private void _writeSemicolon(boolean wantSemicolon) throws IOException { + if (wantSemicolon) { + _out.write(';'); + _newline(); + if (_prettify) { + _out.write(" "); + } + } + } + + /** + * + * + * @param scoped + * @throws IOException + */ + private void _writeScope(IScoped scoped) throws IOException { + IScope scope = scoped.getScopeObject(); + if (!scope.isUnconstrained()) { + Topic[] themes = scope.asSet().toArray(new Topic[scope.size()]); + Arrays.sort(themes, _topicComparator); + _out.write(" @"); + boolean wantComma = false; + for (Topic theme: themes) { + if (wantComma) { + _out.write(", "); + } + _writeTopicRef(theme); + wantComma = true; + } + } + } + + /** + * + * + * @param topic + * @throws IOException + */ + private void _writeTopicRef(Topic topic) throws IOException { + _writeTopicRef(_getTopicReference(topic)); + } + + private void _writeTopicRef(TopicReference topicRef) throws IOException { + _writeTopicRef(topicRef, false); + } + + private void _writeTopicRef(TopicReference topicRef, boolean wantSemicolon) throws IOException { + _writeSemicolon(wantSemicolon); + switch (topicRef.type) { + case TopicReference.ID: + _out.write(topicRef.reference); + return; + case TopicReference.IID: + _out.write('^'); + break; + case TopicReference.SLO: + _out.write("= "); + break; + case TopicReference.SID: + break; + default: + throw new RuntimeException("Internal error: Cannot match topic reference type " + topicRef.type); + } + _writeLocator(topicRef.reference); + } + + private void _writeString(String string) throws IOException { + //TODO: Escape + _out.write('"'); + _out.write(string); + _out.write('"'); + } + + private void _writeLocator(String reference) throws IOException { + _out.write("<" + reference + ">"); + } + + private TopicReference _getTopicReference(Topic topic) { + TopicReference ref = _topic2Reference.get(topic); + if (ref == null) { + final boolean hasIIds = !(_exportIIDs || topic.getItemIdentifiers().isEmpty()); + final boolean hasSids = !topic.getSubjectIdentifiers().isEmpty(); + final boolean hasSlos = !topic.getSubjectLocators().isEmpty(); + if (!hasIIds) { + if (hasSids) { + ref = hasSlos ? null : TopicReference.createSubjectIdentifier(topic.getSubjectIdentifiers().iterator().next().toExternalForm()); + } + else if (hasSlos) { + ref = TopicReference.createSubjectLocator(topic.getSubjectLocators().iterator().next().toExternalForm()); + } + } + if (ref == null) { + if (topic.getItemIdentifiers().size() == 1) { + final String iid = topic.getItemIdentifiers().iterator().next().toExternalForm(); + int idx = iid.lastIndexOf('#'); + if (idx > 0) { + String id = iid.substring(idx + 1); + ref = _isValidId(id) ? TopicReference.createId(id) + : TopicReference.createItemIdentifier("#" + id); + } + else { + ref = TopicReference.createItemIdentifier(iid); + } + } + } + if (ref == null) { + String iri = null; + for (Locator iid: topic.getItemIdentifiers()) { + String addr = iid.getReference(); + int idx = addr.lastIndexOf('#'); + if (idx < 0) { + continue; + } + else { + String id = addr.substring(idx+1); + iri = _isValidId(id) ? id : null; + } + } + if (iri == null) { + iri = "id-" + topic.getId(); + } + ref = TopicReference.createId(iri); + } + _topic2Reference.put(topic, ref); + } + return ref; + } + + private boolean _isValidId(String id) { + return _ID_PATTERN.matcher(id).matches(); + } + + /** + * Writes a literal. + * + * If the datatype is xsd:anyURI or xsd:string, the datatype is omitted. + * If the datatype is natively supported by CTM (like xsd:integer, xsd:decimal) + * the quotes and the datatype are omitted. + * + * @param lit The literal to serialize. + * @throws IOException In case of an error. + */ + private void _writeLiteral(ILiteral lit) throws IOException { + final Locator datatype = lit.getDatatype(); + final String value = lit.getValue(); + if (XSD.ANY_URI.equals(datatype)) { + _writeLocator(value); + } + else if (!XSD.STRING.equals(datatype) + && _isNativelySupported(lit)) { + _out.write(value); + } + else { + _writeString(value); + if (!XSD.STRING.equals(datatype)) { + _out.write("^^"); + String datatypeIRI = datatype.toExternalForm(); + if (datatypeIRI.startsWith(Namespace.XSD)) { + _out.write("xsd:"); + _out.write(datatypeIRI.substring(datatypeIRI.lastIndexOf('#')+1)); + } + else { + _writeLocator(datatypeIRI); + } + } + } + } + + private boolean _isNativelySupported(ILiteral literal) { + Locator datatype = literal.getDatatype(); + return XSD.STRING.equals(datatype) + || XSD.ANY_URI.equals(datatype) + || XSD.DECIMAL.equals(datatype) + || XSD.INTEGER.equals(datatype) + || XSD.DATE.equals(datatype) + || XSD.DATE_TIME.equals(datatype) + || (XSD.DOUBLE.equals(datatype) + && ("INF".equals(literal.getValue())) + || "-INF".equals(literal.getValue())); + } + + /** + * Writes the reifier if <tt>reifiable</tt> is reified. + * + * @param reifiable The reifiable construct. + * @throws IOException If an error occurs. + */ + private void _writeReifier(Reifiable reifiable) throws IOException { + Topic reifier = reifiable.getReifier(); + if (reifier == null) { + return; + } + _out.write(" ~ "); + _writeTopicRef(reifier); + } + + private void _newline() throws IOException { + _out.write('\n'); + } + + private void _writeSection(String name) throws IOException { + _newline(); + _newline(); + _out.write("#-- " + name); + _newline(); + } + + /** + * Writes a warning msg to the log. + * + * This method is used to inform the user that the serialized topic map + * is not valid. + * + * @param msg The warning message. + */ + private static void _reportInvalid(final String msg) { + LOG.warning("Invalid CTM: '" + msg + "'"); + } + + + + private static final class TopicReference { + static final int + ID = 0, + SID = 1, + SLO = 2, + IID = 3; + final int type; + final String reference; + + private TopicReference(int type, String reference) { + this.type = type; + this.reference = reference; + } + + public static TopicReference createId(String reference) { + return new TopicReference(ID, reference); + } + + public static TopicReference createSubjectIdentifier(String reference) { + return new TopicReference(SID, reference); + } + + public static TopicReference createSubjectLocator(String reference) { + return new TopicReference(SLO, reference); + } + + public static TopicReference createItemIdentifier(String reference) { + return new TopicReference(IID, reference); + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof TopicReference)) { + return false; + } + TopicReference other = (TopicReference) obj; + return (type == other.type && reference.equals(other.reference)); + } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + return type + reference.hashCode(); + } + + } + + + /* + * Comparators. + */ + + /** + * Topic comparator. + * - Topics with less types are considered less than others with types. + * - Topics with less subject identifiers are considered less than others with sids. + * - Topics with less subject locators are considered less than other with slos + * - Topics with less item identifiers are less than others with iids + * + */ + private final class TopicComparator implements Comparator<Topic> { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Topic o1, Topic o2) { + if (o1 == o2) { + return 0; + } + int res = o1.getTypes().size() - o2.getTypes().size(); + if (res == 0) { + res = _locSetComparator.compare(o1.getSubjectIdentifiers(), o2.getSubjectIdentifiers()); + if (res == 0) { + res = _locSetComparator.compare(o1.getSubjectLocators(), o2.getSubjectLocators()); + if (res == 0) { + res = _locSetComparator.compare(o1.getItemIdentifiers(), o2.getItemIdentifiers()); + } + } + } + return res; + } + } + + /** + * Abstract comparator that provides some utility methods which handle common + * comparisons. + */ + private abstract class AbstractComparator<T> implements Comparator<T> { + int compareString(String o1, String o2) { + if (o1 == null && o2 != null) { + _reportInvalid("The first string value is null"); + return -1; + } + if (o1 != null && o2 == null) { + _reportInvalid("The second string value is null"); + return +1; + } + return o1.compareTo(o2); + } + /** + * Extracts the type of the typed Topic Maps constructs and compares + * the topics. + * + * @param o1 The first typed Topic Maps construct. + * @param o2 The second typed Topic Maps construct. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int compareType(Typed o1, Typed o2) { + return _topicComparator.compare(o1.getType(), o2.getType()); + } + /** + * Extracts the scope of the scoped Topic Maps constructs and compares + * them. + * + * @param o1 The first scoped Topic Maps construct. + * @param o2 The second scoped Topic Maps construct. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int compareScope(Scoped o1, Scoped o2) { + return _scopeComparator.compare(o1.getScope(), o2.getScope()); + } + /** + * Extracts the reifier of the reifiable Topic Maps constructs and + * compares them. + * + * @param o1 The first reifiable Topic Maps construct. + * @param o2 The second reifiable Topic Maps construct. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int compareReifier(Reifiable o1, Reifiable o2) { + Topic reifier1 = o1.getReifier(); + Topic reifier2 = o2.getReifier(); + int res = 0; + if (reifier1 == null) { + res = reifier2 == null ? 0 : -1; + } + else if (reifier2 == null) { + res = 1; + } + return res != 0 ? res : _topicComparator.compare(reifier1, reifier2); + } + } + + /** + * Enhances the {@link AbstractComparator} with a method to compare the + * value and datatype of an occurrence or variant. + */ + private abstract class AbstractDatatypeAwareComparator<T> extends AbstractComparator<T> { + /** + * Compares the value and datatype of the occurrences / variants. + * + * @param o1 The first occurrence / variant. + * @param o2 The second occurrence / variant. + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + int compareValueDatatype(DatatypeAware o1, DatatypeAware o2) { + ILiteral lit1 = ((ILiteralAware) o1).getLiteral(); + ILiteral lit2 = ((ILiteralAware) o2).getLiteral(); + int res = 0; + if (_isNativelySupported(lit1)) { + res = _isNativelySupported(lit2) ? 0 : -1; + } + else if (_isNativelySupported(lit2)) { + res = 1; + } + if (res == 0) { + res = compareString(lit1.getDatatype().getReference(), lit2.getDatatype().getReference()); + if (res == 0) { + res = compareString(lit1.getValue(), lit2.getValue()); + } + } + return res; + } + } + + /** + * Association comparator. + * + */ + private final class AssociationComparator extends AbstractComparator<Association> { + + private Comparator<Set<Role>> _roleSetComparator; + + AssociationComparator() { + //_roleSetComparator = new RoleSetComparator(); + } + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Association o1, Association o2) { + if (o1 == o2) { + return 0; + } + int res = compareType(o1, o2); + if (res == 0) { + //res = _roleSetComparator.compare(o1.getRoles(), o2.getRoles()); + if (res == 0) { + res = compareScope(o1, o2); + } + } + return res; + } + } + + /** + * Role comparator which ignores the parent association. This comparator + * is meant to be used for roles where the parent is known to be equal or + * unequal. + */ + private class RoleComparator extends AbstractComparator<Role> { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Role o1, Role o2) { + if (o1 == o2) { + return 0; + } + int res = compareType(o1, o2); + if (res == 0) { + res = _topicComparator.compare(o1.getPlayer(), o2.getPlayer()); + } + return res; + } + } + + /** + * Occurrence comparator. + * - Occs in the UCS are less than ones with a special scope. + * - Occs which are not reified are less than ones which are reified. + */ + private final class OccurrenceComparator extends AbstractDatatypeAwareComparator<Occurrence> { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Occurrence o1, Occurrence o2) { + if (o1 == o2) { + return 0; + } + int res = compareType(o1, o2); + if (res == 0) { + res = compareScope(o1, o2); + if (res == 0) { + res = compareReifier(o1, o2); + if (res == 0) { + res = compareValueDatatype(o1, o2); + } + } + } + return res; + } + + } + + /** + * Name comparator. + * - Names with the default name type are less than names with a non-standard type. + * - Names in the UCS are less than ones with a special scope. + * - Names with no variants are less than ones with variants + * - Names which are not reified are less than ones which are reified. + */ + private final class NameComparator extends AbstractComparator<Name> { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Name o1, Name o2) { + if (o1 == o2) { + return 0; + } + int res = compareType(o1, o2); + if (res == 0) { + res = compareScope(o1, o2); + if (res == 0) { + res = o1.getVariants().size() - o2.getVariants().size(); + if (res == 0) { + res = compareReifier(o1, o2); + if (res == 0) { + res = compareString(o1.getValue(), o2.getValue()); + } + } + } + } + return res; + } + + /* (non-Javadoc) + * @see org.tinytim.mio.CTMTopicMapWriter.AbstractComparator#compareType(org.tmapi.core.Typed, org.tmapi.core.Typed) + */ + @Override + int compareType(Typed o1, Typed o2) { + Topic type1 = o1.getType(); + Topic type2 = o2.getType(); + int res = 0; + if (type1.equals(_defaultNameType)) { + res = type2.equals(type1) ? 0 : -1; + } + else if (type2.equals(_defaultNameType)) { + res = 1; + } + return res != 0 ? res : super.compareType(o1, o2); + } + + } + + /** + * Variant comparator. + * - Variants with a lesser scope size are less. + * - Variants which are not reified are less than ones which are reified. + */ + private final class VariantComparator extends AbstractDatatypeAwareComparator<Variant> { + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Variant o1, Variant o2) { + if (o1 == o2) { + return 0; + } + int res = compareScope(o1, o2); + if (res == 0) { + res = compareReifier(o1, o2); + if (res == 0) { + res = compareValueDatatype(o1, o2); + } + } + return res; + } + } + + /** + * Comparator which compares the size of the provided set. + * + * Iff the size of the sets are equal, another comparison method is used + * to compare the content of the sets. + */ + private abstract class AbstractSetComparator<T> implements Comparator<Set<T>> { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Set<T> o1, Set<T> o2) { + int s1 = o1.size(); + int s2 = o2.size(); + int res = s1 - s2; + if (res == 0) { + res = compareContent(o1, o2, s1); + } + return res; + } + + /** + * Called iff the size of the sets is equal. + * + * This method is used to compare the content of the sets. + * + * @param o1 The first set. + * @param o2 The second set. + * @param size The size of the set(s). + * @return A negative integer, zero, or a positive integer as the + * first argument is less than, equal to, or greater than the + * second. + */ + abstract int compareContent(Set<T> o1, Set<T> o2, int size); + } + + /** + * Compares the scope of two scoped Topic Maps constructs. + */ + private final class ScopeComparator extends AbstractSetComparator<Topic> { + + @Override + int compareContent(Set<Topic> o1, Set<Topic> o2, int size) { + int res = 0 ; + Topic[] topics1 = o1.toArray(new Topic[size]); + Topic[] topics2 = o2.toArray(new Topic[size]); + Arrays.sort(topics1, _topicComparator); + Arrays.sort(topics2, _topicComparator); + for (int i=0; i < size && res == 0; i++) { + res = _topicComparator.compare(topics1[i], topics2[i]); + } + return res; + } + } + + /** + * Compares {@link org.tmapi.core.Locator}s. + */ + private final class LocatorComparator implements Comparator<Locator> { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(Locator o1, Locator o2) { + if (o1 == o2) { + return 0; + } + return o1.getReference().compareTo(o2.getReference()); + } + + } + + /** + * Comparator for sets of {@link org.tmapi.core.Locator}s. + */ + private final class LocatorSetComparator extends AbstractSetComparator<Locator> { + + /* (non-Javadoc) + * @see org.tinytim.mio.CTMTopicMapWriter.AbstractSetComparator#compareContent(java.util.Set, java.util.Set, int) + */ + @Override + int compareContent(Set<Locator> o1, Set<Locator> o2, int size) { + int res = 0; + Locator[] locs1 = o1.toArray(new Locator[size]); + Locator[] locs2 = o2.toArray(new Locator[size]); + Arrays.sort(locs1, _locComparator); + Arrays.sort(locs2, _locComparator); + for (int i=0; i < size && res == 0; i++) { + res = _locComparator.compare(locs1[i], locs2[i]); + } + return res; + } + } + +} Property changes on: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CTMTopicMapWriter.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-04 14:25:27
|
Revision: 277 http://tinytim.svn.sourceforge.net/tinytim/?rev=277&view=rev Author: lheuer Date: 2009-03-04 14:25:20 +0000 (Wed, 04 Mar 2009) Log Message: ----------- - The JTMWriter omits the default name type topic if it has no further characteristics - The name type is omitted if it is the default name type Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java 2009-03-03 15:00:25 UTC (rev 276) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java 2009-03-04 14:25:20 UTC (rev 277) @@ -56,6 +56,7 @@ private JSONWriter _out; private String _baseIRI; + private Topic _defaultNameType; /** * Creates a JTM writer, using "utf-8" encoding. @@ -109,6 +110,7 @@ */ @Override public void write(TopicMap topicMap) throws IOException { + _defaultNameType = topicMap.getTopicBySubjectIdentifier(TMDM.TOPIC_NAME); _out.startDocument(); _out.startObject(); _writeKeyValue("version", "1.0"); @@ -153,6 +155,19 @@ * @throws IOException If an error occurs. */ private void _writeTopic(Topic topic) throws IOException { + // Ignore the topic if it is the default name type and it has no further + // characteristics + if (topic.equals(_defaultNameType) + && topic.getReified() == null + && topic.getSubjectIdentifiers().size() == 1 + && topic.getSubjectLocators().isEmpty() + && topic.getItemIdentifiers().isEmpty() + && topic.getRolesPlayed().isEmpty() + && topic.getTypes().isEmpty() + && topic.getNames().isEmpty() + && topic.getOccurrences().isEmpty()) { + return; + } _out.startObject(); _writeItemIdentifiers(topic); _writeLocators("subject_identifiers", topic.getSubjectIdentifiers()); @@ -188,7 +203,9 @@ _out.startObject(); _writeReifier(name); _writeItemIdentifiers(name); - _writeType(name); + if (!name.getType().equals(_defaultNameType)) { + _writeType(name); + } _writeScope(name); _writeKeyValue("value", name.getValue()); Set<Variant> variants = name.getVariants(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-03 15:00:26
|
Revision: 276 http://tinytim.svn.sourceforge.net/tinytim/?rev=276&view=rev Author: lheuer Date: 2009-03-03 15:00:25 +0000 (Tue, 03 Mar 2009) Log Message: ----------- - Updated JTM 1.0 reader to the latest spec. - Writer checks first the subject identifiers and then iids and slos for a topic reference Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-jtm-0.9.3.jar tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapReader.java tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java Modified: tinytim-mio/trunk/lib/semagia-mio-jtm-0.9.3.jar =================================================================== (Binary files differ) Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapReader.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapReader.java 2009-03-02 17:25:00 UTC (rev 275) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapReader.java 2009-03-03 15:00:25 UTC (rev 276) @@ -28,18 +28,21 @@ * {@link TopicMapReader} implementation that deserializes * <a href="http://www.cerny-online.com/jtm/">JSON Topic Maps (JTM)</a>. * <p> - * This reader rejects JTM instances which contain just a single role or - * variant even if they are valid according to the JTM specification. + * This reader rejects JTM instances where the "item_type" is either + * "role" or "variant" even if they are valid according to the JTM specification. * </p> * <p> * Further the reader expects that at least one identity of a topic * (item identifier, subject identifier, subject locator) occurs before any - * occurrence / name. Fragments must start with a "version" property followed - * by the "item_type" property before any further properties are specified. + * occurrence / name. * </p> + * <p> + * The JTM instance must start with a "version" property followed by the + * "item_type" property before any further properties are specified. + * </p> * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public final class JTMTopicMapReader extends AbstractTopicMapReader { Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java 2009-03-02 17:25:00 UTC (rev 275) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java 2009-03-03 15:00:25 UTC (rev 276) @@ -245,7 +245,9 @@ String value = XSD.ANY_URI.equals(datatype) ? datatyped.locatorValue().toExternalForm() : datatyped.getValue(); _writeKeyValue("value", value); - _writeKeyValue("datatype", datatype.toExternalForm()); + if (!XSD.STRING.equals(datatype)) { + _writeKeyValue("datatype", datatype.toExternalForm()); + } } /** @@ -409,18 +411,18 @@ * @return An IRI. */ private String _topicRef(Topic topic) { - Set<Locator> locs = topic.getItemIdentifiers(); + Set<Locator> locs = topic.getSubjectIdentifiers(); if (!locs.isEmpty()) { - return "ii:" + locs.iterator().next().toExternalForm(); - } - locs = topic.getSubjectIdentifiers(); - if (!locs.isEmpty()) { return "si:" + locs.iterator().next().toExternalForm(); } locs = topic.getSubjectLocators(); if (!locs.isEmpty()) { return "sl:" + locs.iterator().next().toExternalForm(); } + locs = topic.getItemIdentifiers(); + if (!locs.isEmpty()) { + return "ii:" + locs.iterator().next().toExternalForm(); + } return "ii:" + _baseIRI + "#" + topic.getId(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-03-02 17:25:04
|
Revision: 275 http://tinytim.svn.sourceforge.net/tinytim/?rev=275&view=rev Author: lheuer Date: 2009-03-02 17:25:00 +0000 (Mon, 02 Mar 2009) Log Message: ----------- Added missing version / item_type info Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java 2009-02-27 12:32:58 UTC (rev 274) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/JTMTopicMapWriter.java 2009-03-02 17:25:00 UTC (rev 275) @@ -111,6 +111,8 @@ public void write(TopicMap topicMap) throws IOException { _out.startDocument(); _out.startObject(); + _writeKeyValue("version", "1.0"); + _writeKeyValue("item_type", "topicmap"); _writeReifier(topicMap); _writeItemIdentifiers(topicMap); _out.key("topics"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-02-27 12:33:03
|
Revision: 274 http://tinytim.svn.sourceforge.net/tinytim/?rev=274&view=rev Author: lheuer Date: 2009-02-27 12:32:58 +0000 (Fri, 27 Feb 2009) Log Message: ----------- - %mergemap support - INF / -INF -> "INF"^^xsd:double support Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-working-draft-2009-02-18.jar tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar Modified: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-working-draft-2009-02-18.jar =================================================================== (Binary files differ) Modified: tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-02-26 15:31:43
|
Revision: 273 http://tinytim.svn.sourceforge.net/tinytim/?rev=273&view=rev Author: lheuer Date: 2009-02-26 15:31:30 +0000 (Thu, 26 Feb 2009) Log Message: ----------- Removed the hint that the CXTM writers implement a draft of CXTM. The output is compatible to the published version of ISO/IEC 13250-4 Modified Paths: -------------- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java tinytim-mio/trunk/src/main/java/org/tinytim/mio15/CXTMTopicMapWriter.java Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2009-02-26 14:29:35 UTC (rev 272) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java 2009-02-26 15:31:30 UTC (rev 273) @@ -65,11 +65,6 @@ * See <a href="http://www.isotopicmaps.org/cxtm/">http://www.isotopicmaps.org/cxtm/</a> * for details. * </p> - * <p> - * <em>CAUTION</em>: This class implements the - * <a href="http://www.isotopicmaps.org/cxtm/">CXTM draft dtd. 2008-05-15</a>, - * the output may change in the future. - * </p> * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> * @version $Rev$ - $Date$ Modified: tinytim-mio/trunk/src/main/java/org/tinytim/mio15/CXTMTopicMapWriter.java =================================================================== --- tinytim-mio/trunk/src/main/java/org/tinytim/mio15/CXTMTopicMapWriter.java 2009-02-26 14:29:35 UTC (rev 272) +++ tinytim-mio/trunk/src/main/java/org/tinytim/mio15/CXTMTopicMapWriter.java 2009-02-26 15:31:30 UTC (rev 273) @@ -73,11 +73,6 @@ * for details. * </p> * <p> - * <em>CAUTION</em>: This class implements the - * <a href="http://www.isotopicmaps.org/cxtm/">CXTM draft dtd. 2008-05-15</a>, - * the output may change in the future. - * </p> - * <p> * The canonicalizer IS NOT a generic TMAPI-compatible implementation. It * requires tinyTiM. The canonicalizer requires that the property * {@link org.tinytim.Property#XTM10_REIFICATION} is set to <tt>false</tt> and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-02-26 14:29:47
|
Revision: 272 http://tinytim.svn.sourceforge.net/tinytim/?rev=272&view=rev Author: lheuer Date: 2009-02-26 14:29:35 +0000 (Thu, 26 Feb 2009) Log Message: ----------- Some internal changes, still no support for %include and %mergemap, though Modified Paths: -------------- tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-working-draft-2009-02-18.jar tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar Modified: tinytim-mio/trunk/lib/semagia-mio-ctm-0.9.3-working-draft-2009-02-18.jar =================================================================== (Binary files differ) Modified: tinytim-mio/trunk/lib/semagia-mio-snello-0.9.3.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-02-25 15:16:10
|
Revision: 271 http://tinytim.svn.sourceforge.net/tinytim/?rev=271&view=rev Author: lheuer Date: 2009-02-25 15:16:05 +0000 (Wed, 25 Feb 2009) Log Message: ----------- Updated build scripts Modified Paths: -------------- tinytim-mio/trunk/build-15.xml tinytim-mio/trunk/build.xml Modified: tinytim-mio/trunk/build-15.xml =================================================================== --- tinytim-mio/trunk/build-15.xml 2009-02-25 14:15:13 UTC (rev 270) +++ tinytim-mio/trunk/build-15.xml 2009-02-25 15:16:05 UTC (rev 271) @@ -13,7 +13,6 @@ <property name="lib.tinytim" value="${dir.lib}/tinytim-1.5.0b2.jar"/> <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.6.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.3.jar"/> - <property name="lib.json" value="${dir.lib}/json_simple.jar"/> <target name="help"> <echo message="------------------------"/> @@ -136,7 +135,6 @@ <pathelement location="${lib.tinytim}"/> <pathelement location="${lib.mio}"/> <pathelement location="${lib.logging}"/> - <pathelement location="${lib.json}"/> </classpath> <src path="${dir.src}"/> </javac> Modified: tinytim-mio/trunk/build.xml =================================================================== --- tinytim-mio/trunk/build.xml 2009-02-25 14:15:13 UTC (rev 270) +++ tinytim-mio/trunk/build.xml 2009-02-25 15:16:05 UTC (rev 271) @@ -14,7 +14,6 @@ <property name="lib.tinytim.tests" value="${dir.lib}/tinytim-2.0.0a4-tests.jar"/> <property name="lib.logging" value="${dir.lib}/slf4j-api-1.5.6.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.3.jar"/> - <property name="lib.json" value="${dir.lib}/json_simple.jar"/> <target name="help"> <echo message="------------------------"/> @@ -143,7 +142,6 @@ <pathelement location="${lib.tinytim.tests}"/> <pathelement location="${lib.mio}"/> <pathelement location="${lib.logging}"/> - <pathelement location="${lib.json}"/> </classpath> <src path="${dir.src}"/> </javac> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-02-25 14:15:17
|
Revision: 270 http://tinytim.svn.sourceforge.net/tinytim/?rev=270&view=rev Author: lheuer Date: 2009-02-25 14:15:13 +0000 (Wed, 25 Feb 2009) Log Message: ----------- Deleted unused licenses Removed Paths: ------------- tinytim-mio/trunk/lib/LICENSE.json_simple.txt tinytim-mio/trunk/lib/LICENSE.sesame.txt Deleted: tinytim-mio/trunk/lib/LICENSE.json_simple.txt =================================================================== --- tinytim-mio/trunk/lib/LICENSE.json_simple.txt 2009-02-25 13:54:30 UTC (rev 269) +++ tinytim-mio/trunk/lib/LICENSE.json_simple.txt 2009-02-25 14:15:13 UTC (rev 270) @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - Deleted: tinytim-mio/trunk/lib/LICENSE.sesame.txt =================================================================== --- tinytim-mio/trunk/lib/LICENSE.sesame.txt 2009-02-25 13:54:30 UTC (rev 269) +++ tinytim-mio/trunk/lib/LICENSE.sesame.txt 2009-02-25 14:15:13 UTC (rev 270) @@ -1,25 +0,0 @@ -Copyright Aduna (http://www.aduna-software.com/) \xA9 2001-2007 -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |