diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java b/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java index 5895eb4..5aa20c0 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/Constants.java @@ -27,7 +27,7 @@ public class Constants { /** * Prefix used to shorten {@link #NS_TERMIT}. */ - public static final String NS_TERMIT_PREFIX = "ddo"; + public static final String NS_TERMIT_PREFIX = "termit"; /** * IRI of the annotation type, written in full. diff --git a/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java b/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java index 65fd5dc..806aea2 100644 --- a/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java +++ b/core/src/main/java/cz/cvut/kbss/textanalysis/service/html2rdfa/Annotator.java @@ -194,7 +194,7 @@ private void annotateNode(final Element node, final String content, final Phrase int i) { node.attr("about", Constants.BNODE_PREFIX + uniqueId + i); String iri = phrase.getTermIri(); - node.attr("property", "ddo:je-výskytem-termu"); + node.attr("property", Constants.NS_TERMIT + ":je-přiřazením-termu"); if ((iri != null) && (!iri.isEmpty())) { node.attr("resource", phrase.getTermIri()); } else { diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java index 6b34ad5..79f693b 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/AnnotatorTest.java @@ -17,6 +17,7 @@ */ package cz.cvut.kbss.service.textanalysis.html2rdfa; +import cz.cvut.kbss.textanalysis.Constants; import cz.cvut.kbss.textanalysis.model.Phrase; import cz.cvut.kbss.textanalysis.model.Word; import cz.cvut.kbss.textanalysis.service.html2rdfa.Annotator; @@ -51,9 +52,9 @@ public void testSingleTermOccurrence() { final Element element = (Element) aNodes[0]; Assertions.assertNotNull(element.attr("about")); - Assertions.assertEquals("ddo:je-výskytem-termu",element.attr("property")); + Assertions.assertEquals(Constants.NS_TERMIT + ":je-přiřazením-termu", element.attr("property")); Assertions.assertEquals("http://test.org/pojem/Test",element.attr("resource")); - Assertions.assertEquals("ddo:výskyt-termu",element.attr("typeof")); + Assertions.assertEquals(Constants.NS_TERMIT_PREFIX + ":výskyt-termu",element.attr("typeof")); } @Test diff --git a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java index 356cd6c..ed30c6d 100644 --- a/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java +++ b/core/src/test/java/cz/cvut/kbss/service/textanalysis/html2rdfa/HTMLParserTest.java @@ -20,6 +20,7 @@ import static org.mockito.Mockito.lenient; +import cz.cvut.kbss.textanalysis.Constants; import cz.cvut.kbss.textanalysis.keywordextractor.KeywordExtractorAPI; import cz.cvut.kbss.textanalysis.lemmatizer.LemmatizerApi; import cz.cvut.kbss.textanalysis.service.ChunkAnnotationService; @@ -65,7 +66,7 @@ public void init() { "

" + chunks[1] + "

" + chunks[2] + "

"; final Document doc = Jsoup.parse(html); final Document doc2 = sut.annotate(chunkAnnotationService,doc,"cs"); - Assertions.assertEquals(3, doc2.select("span[typeof='ddo:výskyt-termu']").size()); + Assertions.assertEquals(3, doc2.select("span[typeof='" + Constants.NS_TERMIT_PREFIX + ":výskyt-termu']").size()); } @Test public void testParseInvalidHtmlSuccessfully() {