Skip to content

Commit

Permalink
fix bug IRI resolution of datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
krosse committed Dec 14, 2010
1 parent 0dfd8e9 commit eda6fe7
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 32 deletions.
11 changes: 4 additions & 7 deletions ctm-serializer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
<id>Semagia releases</id>
<name>Semagia Releases</name>
<url>http://repository.semagia.com/releases/</url>
</repository>
<repository>
<id>org.tmapi.snapshot</id>
<url>http://www.tmapi.org/maven-repository/snapshots/</url>
</repository>
</repositories>
<dependencies>
Expand Down Expand Up @@ -103,13 +107,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.tmapi</groupId>
<artifactId>tmapi</artifactId>
<version>2.0.2</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.tmapi</groupId>
<artifactId>tmapi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static de.topicmapslab.ctm.writer.utility.CTMTokens.PREFIXEND;
import static de.topicmapslab.ctm.writer.utility.CTMTokens.QUOTE;
import static de.topicmapslab.ctm.writer.utility.CTMTokens.TRIPPLEQUOTE;
import static de.topicmapslab.ctm.writer.utility.CTMTokens.WHITESPACE;

import java.io.IOException;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -160,8 +161,9 @@ else if (XmlSchemeDatatypes.XSD_INTEGER.equals(datatype_) || XmlSchemeDatatypes.
} else {
buffer.append(false, QUOTE, value, QUOTE);
}
buffer.append(false, DATATYPE, datatype_);
buffer.append(false, DATATYPE, PREFIXBEGIN + datatype_ + PREFIXEND);
}
buffer.append(WHITESPACE);
return true;
}

Expand Down
11 changes: 11 additions & 0 deletions ctm-serializer/src/test/java/LittleExportImportTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,15 @@ public void testbla() throws Exception {
reader.read();

}


public void testToyImport() throws Exception {
File file = new File("src/test/resources/toyTM.ctm");

TopicMap tm = TopicMapSystemFactory.newInstance().newTopicMapSystem()
.createTopicMap("http://www.topicmapslab.de/tmql4j/import-toy-tm");

CTMTopicMapReader reader = new CTMTopicMapReader(tm,file);
reader.read();
}
}
4 changes: 2 additions & 2 deletions ctm-serializer/src/test/resources/ctm.ctm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# reifier of the topicmap

# topic definitions
^<http://fallback-test/-1014227527148176432>
ako ^<http://fallback-test/-1014227527148176432>;
^<http://fallback-test/-7665283212904593459>
ako ^<http://fallback-test/-7665283212904593459>;
.

# association definitions
Expand Down
44 changes: 22 additions & 22 deletions ctm-serializer/src/test/resources/ctm2.ctm
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,45 @@
~ <http://reifier>

# topic definitions
<http://de.topicmapslab/occ-type> .

<http://de.topicmapslab/si-instanceA>
isa <http://de.topicmapslab/si-type>;
- <http://psi.topicmaps.org/iso13250/model/topic-name> : "name"@<http://de.topicmapslab/theme2>, <http://de.topicmapslab/theme> ~ <http://de.topicmapslab/reifier-name> ;
- <http://psi.topicmaps.org/iso13250/model/topic-name> : "name2"(<http://google.de/variant.jpg>@<http://de.topicmapslab/theme> ~ <http://de.topicmapslab/reifier-variant> ) ;
<http://de.topicmapslab/occ-type> : "äüößÜÄÖ€@âéè"@<http://de.topicmapslab/theme> ;
<http://de.topicmapslab/occ-type> : <http://google.de/occurrence>@<http://de.topicmapslab/theme> ~ <http://de.topicmapslab/reifier-occ> ;
<http://de.topicmapslab/occ-type> : """This is a quoted "occurrence"."""@<http://de.topicmapslab/theme> ;
<http://de.topicmapslab/instanceA>;
= <http://de.topicmapslab/sl-instanceA>.
<http://reifier> .

<http://de.topicmapslab/player-b> .

<http://de.topicmapslab/theme> .

<http://de.topicmapslab/role-type-a> .
<http://de.topicmapslab/player-a> .

<http://de.topicmapslab/reifier-name> .

<http://de.topicmapslab/reifier-variant> .

<http://de.topicmapslab/role-type-b> .

<http://de.topicmapslab/theme2> .
<http://de.topicmapslab/occ-type> .

<http://de.topicmapslab/si-type>
= <http://de.topicmapslab/sl-type>.

<http://reifier> .
<http://de.topicmapslab/reifier-occ> .

<http://de.topicmapslab/player-a> .
<http://de.topicmapslab/si-instanceA>
isa <http://de.topicmapslab/si-type>;
- <http://psi.topicmaps.org/iso13250/model/topic-name> : "name"@<http://de.topicmapslab/theme>, <http://de.topicmapslab/theme2> ~ <http://de.topicmapslab/reifier-name> ;
- <http://psi.topicmaps.org/iso13250/model/topic-name> : "name2"(<http://google.de/variant.jpg> @<http://de.topicmapslab/theme> ~ <http://de.topicmapslab/reifier-variant> ) ;
<http://de.topicmapslab/occ-type> : <http://google.de/occurrence> @<http://de.topicmapslab/theme> ~ <http://de.topicmapslab/reifier-occ> ;
<http://de.topicmapslab/occ-type> : """This is a quoted "occurrence".""" @<http://de.topicmapslab/theme> ;
<http://de.topicmapslab/occ-type> : "äüößÜÄÖ€@âéè" @<http://de.topicmapslab/theme> ;
<http://de.topicmapslab/instanceA>;
= <http://de.topicmapslab/sl-instanceA>.

<http://de.topicmapslab/reifier-occ> .
<http://de.topicmapslab/role-type-b> .

<http://de.topicmapslab/theme> .

<http://de.topicmapslab/theme2> .

<http://de.topicmapslab/role-type-a> .

# association definitions
<http://de.topicmapslab/si-type> (
<http://de.topicmapslab/role-type-b> : <http://de.topicmapslab/player-b>,
<http://de.topicmapslab/role-type-a> : <http://de.topicmapslab/player-a>
<http://de.topicmapslab/role-type-a> : <http://de.topicmapslab/player-a>,
<http://de.topicmapslab/role-type-b> : <http://de.topicmapslab/player-b>
)

# Generated by the CTM Topic Map Writer.

0 comments on commit eda6fe7

Please sign in to comment.