diff --git a/src/main/resources/mapping b/jopa-config/mapping similarity index 77% rename from src/main/resources/mapping rename to jopa-config/mapping index ef6e60931..d65456a17 100644 --- a/src/main/resources/mapping +++ b/jopa-config/mapping @@ -1,7 +1,7 @@ -http://onto.fel.cvut.cz/ontologies/application/termit > ../../../ontology/termit-slovník.ttl -http://onto.fel.cvut.cz/ontologies/application/termit/glosář > ../../../ontology/termit-glosář.ttl -http://onto.fel.cvut.cz/ontologies/application/termit/model > ../../../ontology/termit-model.ttl -http://rdfs.org/sioc/ns# > ../../../ontology/sioc-ns.rdf +http://onto.fel.cvut.cz/ontologies/application/termit > ../ontology/termit-slovník.ttl +http://onto.fel.cvut.cz/ontologies/application/termit/glosář > ../ontology/termit-glosář.ttl +http://onto.fel.cvut.cz/ontologies/application/termit/model > ../ontology/termit-model.ttl +http://rdfs.org/sioc/ns# > ../ontology/sioc-ns.rdf http://www.w3.org/ns/activitystreams# > https://raw.githubusercontent.com/w3c/activitystreams/master/vocabulary/activitystreams2.owl https://slovník.gov.cz/datový/pracovní-prostor/glosář > https://raw.githubusercontent.com/opendata-mvcr/ssp/master/content/vocabularies/d-sgov-pracovn%C3%AD-prostor-0.0.1/d-sgov-pracovn%C3%AD-prostor-0.0.1-glos%C3%A1%C5%99.ttl https://slovník.gov.cz/datový/pracovní-prostor/model > https://raw.githubusercontent.com/opendata-mvcr/ssp/master/content/vocabularies/d-sgov-pracovn%C3%AD-prostor-0.0.1/d-sgov-pracovn%C3%AD-prostor-0.0.1-model.ttl diff --git a/jopa-config/prefixes b/jopa-config/prefixes new file mode 100644 index 000000000..b2161f38b --- /dev/null +++ b/jopa-config/prefixes @@ -0,0 +1,3 @@ +http://rdfs.org/sioc/ns#=sioc +http://onto.fel.cvut.cz/ontologies/dataset-descriptor=ddo +https://slovník.gov.cz/datový/pracovní-prostor/model=d-sgov-pracovní-prostor-pojem diff --git a/pom.xml b/pom.xml index 6100d5c1f..13095cefb 100644 --- a/pom.xml +++ b/pom.xml @@ -500,10 +500,11 @@ cz.cvut.kbss.termit.util ${project.basedir}/src/main/generated-sources http://onto.fel.cvut.cz/ontologies/application/termit - ${project.basedir}/src/main/resources/mapping + ${project.basedir}/jopa-config/mapping true true true + ${project.basedir}/jopa-config/prefixes diff --git a/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java b/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java index 4a5992ef2..e3bf51b17 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java @@ -71,7 +71,7 @@ private AccessHolderDto accessHolderToDto(T holde dto.setLabel(MultilingualString.create(user.getFullName(), config.getPersistence().getLanguage())); break; - case cz.cvut.kbss.termit.util.Vocabulary.s_c_Usergroup: + case cz.cvut.kbss.termit.util.Vocabulary.s_c_sioc_Usergroup: dto.setLabel(MultilingualString.create(((UserGroup) holder).getLabel(), config.getPersistence().getLanguage())); break; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java b/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java index cb83e25d7..e0a6cdde5 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java @@ -51,13 +51,13 @@ public class FullTextSearchResult implements HasIdentifier, HasTypes, Serializab @OWLAnnotationProperty(iri = RDFS.LABEL) private String label; - @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_termit + "/fts/snippet-text") + @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_TERMIT + "/fts/snippet-text") private String snippetText; - @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_termit + "/fts/snippet-field") + @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_TERMIT + "/fts/snippet-field") private String snippetField; - @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_termit + "/fts/score") + @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_TERMIT + "/fts/score") private Double score; @OWLObjectProperty(iri = Vocabulary.s_p_je_pojmem_ze_slovniku) diff --git a/src/main/java/cz/cvut/kbss/termit/model/AbstractTerm.java b/src/main/java/cz/cvut/kbss/termit/model/AbstractTerm.java index f1f4b5fc7..3b92ae797 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/AbstractTerm.java +++ b/src/main/java/cz/cvut/kbss/termit/model/AbstractTerm.java @@ -172,10 +172,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof AbstractTerm)) { + if (!(o instanceof AbstractTerm that)) { return false; } - AbstractTerm that = (AbstractTerm) o; return Objects.equals(getUri(), that.getUri()); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/TextAnalysisRecord.java b/src/main/java/cz/cvut/kbss/termit/model/TextAnalysisRecord.java index 85456e47a..837e55280 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/TextAnalysisRecord.java +++ b/src/main/java/cz/cvut/kbss/termit/model/TextAnalysisRecord.java @@ -81,10 +81,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof TextAnalysisRecord)) { + if (!(o instanceof TextAnalysisRecord that)) { return false; } - TextAnalysisRecord that = (TextAnalysisRecord) o; return Objects.equals(date, that.date) && Objects.equals(analyzedResource, that.analyzedResource) && Objects.equals(vocabularies, that.vocabularies); diff --git a/src/main/java/cz/cvut/kbss/termit/model/User.java b/src/main/java/cz/cvut/kbss/termit/model/User.java index 1cdb56b44..266d971df 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/User.java +++ b/src/main/java/cz/cvut/kbss/termit/model/User.java @@ -108,10 +108,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof User)) { + if (!(o instanceof User that)) { return false; } - User that = (User) o; return Objects.equals(getUri(), that.getUri()) && Objects.equals(username, that.username); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java b/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java index 6db6e2060..29b91d0dc 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java +++ b/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java @@ -56,7 +56,7 @@ public class UserAccount implements HasIdentifier, HasTypes, Serializable { @OWLDataProperty(iri = Vocabulary.s_p_ma_heslo) private String password; - @OWLDataProperty(iri = Vocabulary.s_p_last_activity_date) + @OWLDataProperty(iri = Vocabulary.s_p_sioc_last_activity_date) private Instant lastSeen; @Types @@ -255,10 +255,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof UserAccount)) { + if (!(o instanceof UserAccount that)) { return false; } - UserAccount that = (UserAccount) o; return Objects.equals(getUri(), that.getUri()) && Objects.equals(username, that.username); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java b/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java index 40b6e93bc..19caf4e7c 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java +++ b/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java @@ -27,20 +27,20 @@ import java.util.Objects; import java.util.Set; -@OWLClass(iri = Vocabulary.s_c_Usergroup) +@OWLClass(iri = Vocabulary.s_c_sioc_Usergroup) public class UserGroup extends AccessControlAgent { /** * Namespace of UserGroup identifiers. */ - public static final String NAMESPACE = "http://rdfs.org/sioc/ns#"; + public static final String NAMESPACE = Vocabulary.ONTOLOGY_IRI_SIOC; @NotBlank @ParticipationConstraints(nonEmpty = true) @OWLAnnotationProperty(iri = DC.Terms.TITLE) private String label; - @OWLObjectProperty(iri = Vocabulary.s_p_has_member_A, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_sioc_has_member, fetch = FetchType.EAGER) private Set members; public String getLabel() { diff --git a/src/main/java/cz/cvut/kbss/termit/model/Vocabulary.java b/src/main/java/cz/cvut/kbss/termit/model/Vocabulary.java index 17eea3966..46051babb 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/Vocabulary.java +++ b/src/main/java/cz/cvut/kbss/termit/model/Vocabulary.java @@ -174,10 +174,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Vocabulary)) { + if (!(o instanceof Vocabulary that)) { return false; } - Vocabulary that = (Vocabulary) o; return Objects.equals(getUri(), that.getUri()); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java b/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java index d48021425..b9ff030c2 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java +++ b/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java @@ -87,10 +87,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof AccessControlRecord)) { + if (!(o instanceof AccessControlRecord that)) { return false; } - AccessControlRecord that = (AccessControlRecord) o; return accessLevel == that.accessLevel && Objects.equals(holder, that.holder); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java b/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java index 01b30b71b..2a388df19 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java +++ b/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java @@ -83,10 +83,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof AbstractChangeRecord)) { + if (!(o instanceof AbstractChangeRecord that)) { return false; } - AbstractChangeRecord that = (AbstractChangeRecord) o; return Objects.equals(timestamp, that.timestamp) && Objects.equals(changedEntity, that.changedEntity); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/changetracking/UpdateChangeRecord.java b/src/main/java/cz/cvut/kbss/termit/model/changetracking/UpdateChangeRecord.java index 4f6ce9888..ecbcc41ee 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/changetracking/UpdateChangeRecord.java +++ b/src/main/java/cz/cvut/kbss/termit/model/changetracking/UpdateChangeRecord.java @@ -77,13 +77,12 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof UpdateChangeRecord)) { + if (!(o instanceof UpdateChangeRecord that)) { return false; } - if (!super.equals(o)) { + if (!super.equals(that)) { return false; } - UpdateChangeRecord that = (UpdateChangeRecord) o; return changedAttribute.equals(that.changedAttribute); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java b/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java index ce1e65783..e3731c8b4 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java +++ b/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java @@ -42,11 +42,11 @@ public class Comment extends AbstractEntity { private URI asset; @ParticipationConstraints(nonEmpty = true) - @OWLDataProperty(iri = Vocabulary.s_p_content_A) + @OWLDataProperty(iri = Vocabulary.s_p_sioc_content) private String content; @ParticipationConstraints(nonEmpty = true) - @OWLObjectProperty(iri = Vocabulary.s_p_has_creator, fetch = FetchType.EAGER) + @OWLObjectProperty(iri = Vocabulary.s_p_sioc_has_creator, fetch = FetchType.EAGER) private User author; @ParticipationConstraints(nonEmpty = true) @@ -123,10 +123,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Comment)) { + if (!(o instanceof Comment comment)) { return false; } - Comment comment = (Comment) o; return Objects.equals(asset, comment.asset) && Objects.equals(content, comment.content) && Objects.equals(author, comment.author) && diff --git a/src/main/java/cz/cvut/kbss/termit/model/comment/CommentReaction.java b/src/main/java/cz/cvut/kbss/termit/model/comment/CommentReaction.java index 2480f0d4b..58daae680 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/comment/CommentReaction.java +++ b/src/main/java/cz/cvut/kbss/termit/model/comment/CommentReaction.java @@ -82,10 +82,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof CommentReaction)) { + if (!(o instanceof CommentReaction reaction)) { return false; } - CommentReaction reaction = (CommentReaction) o; return Objects.equals(actor, reaction.actor) && Objects.equals(object, reaction.object) && Objects.equals(types, reaction.types); diff --git a/src/main/java/cz/cvut/kbss/termit/model/resource/Document.java b/src/main/java/cz/cvut/kbss/termit/model/resource/Document.java index 6cdec7374..87c6a39a7 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/resource/Document.java +++ b/src/main/java/cz/cvut/kbss/termit/model/resource/Document.java @@ -23,13 +23,11 @@ import cz.cvut.kbss.jopa.model.annotations.OWLClass; import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; import cz.cvut.kbss.jsonld.annotation.JsonLdAttributeOrder; -import cz.cvut.kbss.termit.exception.TermItException; import cz.cvut.kbss.termit.model.changetracking.Audited; import cz.cvut.kbss.termit.model.util.SupportsStorage; import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.util.Vocabulary; -import java.lang.reflect.Field; import java.net.URI; import java.util.HashSet; import java.util.Objects; @@ -103,10 +101,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Document)) { + if (!(o instanceof Document document)) { return false; } - Document document = (Document) o; return Objects.equals(getUri(), document.getUri()); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/resource/File.java b/src/main/java/cz/cvut/kbss/termit/model/resource/File.java index d0cf24819..96cadfe60 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/resource/File.java +++ b/src/main/java/cz/cvut/kbss/termit/model/resource/File.java @@ -63,10 +63,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof File)) { + if (!(o instanceof File file)) { return false; } - File file = (File) o; return Objects.equals(getUri(), file.getUri()); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java b/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java index bf0791874..a29612c5d 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java +++ b/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java @@ -75,10 +75,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Resource)) { + if (!(o instanceof Resource resource)) { return false; } - Resource resource = (Resource) o; return Objects.equals(getUri(), resource.getUri()); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java index 54dec7fdd..740fb60e5 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java @@ -54,10 +54,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof CssSelector)) { + if (!(o instanceof CssSelector that)) { return false; } - CssSelector that = (CssSelector) o; return Objects.equals(value, that.value); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java index 6c0ec1e55..55cb77191 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java @@ -54,10 +54,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof FragmentSelector)) { + if (!(o instanceof FragmentSelector that)) { return false; } - FragmentSelector that = (FragmentSelector) o; return Objects.equals(value, that.value); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java index 7eef87f94..538d9dd87 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java @@ -75,10 +75,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof TextPositionSelector)) { + if (!(o instanceof TextPositionSelector selector)) { return false; } - TextPositionSelector selector = (TextPositionSelector) o; return Objects.equals(start, selector.start) && Objects.equals(end, selector.end); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java index d37d39b0c..e669f4f3c 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java @@ -82,10 +82,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof TextQuoteSelector)) { + if (!(o instanceof TextQuoteSelector selector)) { return false; } - TextQuoteSelector selector = (TextQuoteSelector) o; return Objects.equals(exactMatch, selector.exactMatch) && Objects.equals(prefix, selector.prefix) && Objects.equals(suffix, selector.suffix); diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java index 4822cd532..d7097a5e4 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java @@ -54,10 +54,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof XPathSelector)) { + if (!(o instanceof XPathSelector that)) { return false; } - XPathSelector that = (XPathSelector) o; return Objects.equals(value, that.value); } diff --git a/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java b/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java index 8e30f2ed9..5f6c81068 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java +++ b/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java @@ -124,10 +124,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Term)) { + if (!(o instanceof Term term)) { return false; } - Term term = (Term) o; return Objects.equals(getId(), term.getUri()); } diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/context/CachingVocabularyContextMapper.java b/src/main/java/cz/cvut/kbss/termit/persistence/context/CachingVocabularyContextMapper.java index 9816792fc..15d31e18f 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/context/CachingVocabularyContextMapper.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/context/CachingVocabularyContextMapper.java @@ -70,7 +70,7 @@ public void load() { "FILTER NOT EXISTS { ?g ?basedOnVersion ?canonical . } " + "}}") .setParameter("type", URI.create(Vocabulary.s_c_slovnik)) - .setParameter("basedOnVersion", URI.create(Vocabulary.s_p_vychazi_z_verze)) + .setParameter("basedOnVersion", URI.create(Vocabulary.s_p_d_sgov_pracovni_prostor_pojem_vychazi_z_verze)) .getResultStream().forEach(row -> { assert row instanceof Object[]; assert ((Object[]) row).length == 2; diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapper.java b/src/main/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapper.java index 9372e6b75..8b0218a6b 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapper.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapper.java @@ -63,7 +63,7 @@ public URI getVocabularyContext(URI vocabularyUri) { "}}", URI.class) .setParameter("type", URI.create(Vocabulary.s_c_slovnik)) .setParameter("vocabulary", vocabularyUri) - .setParameter("basedOnVersion", URI.create(Vocabulary.s_p_vychazi_z_verze)) + .setParameter("basedOnVersion", URI.create(Vocabulary.s_p_d_sgov_pracovni_prostor_pojem_vychazi_z_verze)) .getSingleResult(); } catch (NoResultException e) { LOG.debug("No context mapped for vocabulary {}, returning the vocabulary IRI as context identifier.", diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/context/StaticContexts.java b/src/main/java/cz/cvut/kbss/termit/persistence/context/StaticContexts.java index d1433f1be..d624d67cf 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/context/StaticContexts.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/context/StaticContexts.java @@ -30,7 +30,7 @@ public class StaticContexts { /** * Repository context for storing {@link cz.cvut.kbss.termit.model.UserGroup} instances. */ - public static final String USER_GROUPS = Vocabulary.s_c_Usergroup; + public static final String USER_GROUPS = Vocabulary.s_c_sioc_Usergroup; /** * Repository context for storing {@link cz.cvut.kbss.termit.model.acl.AccessControlList} instances. diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDao.java index d598b4c2c..31651ca6a 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDao.java @@ -148,7 +148,7 @@ public Page findLastCommentedInReaction(User author, Pag .setParameter("hasLabel", labelProperty()) .setParameter("hasModifiedTime", URI.create(Vocabulary.s_p_ma_datum_a_cas_posledni_modifikace)) .setParameter("hasCreatedTime", URI.create(Vocabulary.s_p_ma_datum_a_cas_vytvoreni)) - .setParameter("hasAuthor", URI.create(Vocabulary.s_p_has_creator)) + .setParameter("hasAuthor", URI.create(Vocabulary.s_p_sioc_has_creator)) .setParameter("language", config.getLanguage()) .setParameter("author", author) .setMaxResults(pageSpec.getPageSize()).setFirstResult((int) pageSpec.getOffset()) diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDao.java index 7079c828f..0701205ad 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDao.java @@ -41,7 +41,7 @@ public UserGroupDao(EntityManager em, DescriptorFactory descriptorFactory) { public void persist(UserGroup entity) { Objects.requireNonNull(entity); if (entity.getUri() == null) { - entity.setUri(IdentifierResolver.generateSyntheticIdentifier(Vocabulary.s_c_Usergroup)); + entity.setUri(IdentifierResolver.generateSyntheticIdentifier(Vocabulary.s_c_sioc_Usergroup)); } super.persist(entity); } diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentDao.java index 5168368c4..7e18df6e5 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentDao.java @@ -199,7 +199,7 @@ private List findUniqueLastModifiedEntitiesBy(User author, int limit) { .setParameter("commentType", URI.create(Vocabulary.s_c_Comment)) .setParameter("hasModificationDate", URI.create(Vocabulary.s_p_ma_datum_a_cas_posledni_modifikace)) .setParameter("hasCreationDate", URI.create(Vocabulary.s_p_ma_datum_a_cas_vytvoreni)) - .setParameter("hasEditor", URI.create(Vocabulary.s_p_has_creator)) + .setParameter("hasEditor", URI.create(Vocabulary.s_p_sioc_has_creator)) .setParameter("author", author.getUri()) .setParameter("hasAsset", URI.create(Vocabulary.s_p_topic)) .setMaxResults(limit) diff --git a/src/main/java/cz/cvut/kbss/termit/rest/dto/UserUpdateDto.java b/src/main/java/cz/cvut/kbss/termit/rest/dto/UserUpdateDto.java index 240840474..2dcd01f63 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/dto/UserUpdateDto.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/dto/UserUpdateDto.java @@ -33,7 +33,7 @@ @OWLClass(iri = Vocabulary.s_c_uzivatel_termitu) public class UserUpdateDto extends UserAccount { - @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_termit + "/original-password") + @OWLDataProperty(iri = Vocabulary.ONTOLOGY_IRI_TERMIT + "/original-password") private String originalPassword; public String getOriginalPassword() { diff --git a/src/main/java/cz/cvut/kbss/termit/service/init/AdminAccountGenerator.java b/src/main/java/cz/cvut/kbss/termit/service/init/AdminAccountGenerator.java index e91ddf68a..9a5ab7b0e 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/init/AdminAccountGenerator.java +++ b/src/main/java/cz/cvut/kbss/termit/service/init/AdminAccountGenerator.java @@ -107,7 +107,7 @@ private File createHiddenFile() throws IOException { static UserAccount getDefaultAdminInstance() { final UserAccount admin = new UserAccount(); - admin.setUri(URI.create(Vocabulary.ONTOLOGY_IRI_termit + "/system-admin-user")); + admin.setUri(URI.create(Vocabulary.ONTOLOGY_IRI_TERMIT + "/system-admin-user")); admin.setFirstName("System"); admin.setLastName("Administrator"); admin.setUsername("termit-admin@kbss.felk.cvut.cz"); diff --git a/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java b/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java index a501c2455..f2e1ce4b1 100644 --- a/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java @@ -89,7 +89,7 @@ static Stream holdersGenerator() { rThree.setUri(Generator.generateUri()); return Stream.of( Arguments.of(rOne, Vocabulary.s_c_uzivatel_termitu), - Arguments.of(rTwo, Vocabulary.s_c_Usergroup), + Arguments.of(rTwo, Vocabulary.s_c_sioc_Usergroup), Arguments.of(rThree, Vocabulary.s_c_uzivatelska_role) ); } diff --git a/src/test/java/cz/cvut/kbss/termit/environment/Environment.java b/src/test/java/cz/cvut/kbss/termit/environment/Environment.java index 76a91632d..2cbbf7b76 100644 --- a/src/test/java/cz/cvut/kbss/termit/environment/Environment.java +++ b/src/test/java/cz/cvut/kbss/termit/environment/Environment.java @@ -55,7 +55,7 @@ public class Environment { - public static final String BASE_URI = Vocabulary.ONTOLOGY_IRI_termit; + public static final String BASE_URI = Vocabulary.ONTOLOGY_IRI_TERMIT; public static final String LANGUAGE = Constants.DEFAULT_LANGUAGE; diff --git a/src/test/java/cz/cvut/kbss/termit/environment/Generator.java b/src/test/java/cz/cvut/kbss/termit/environment/Generator.java index c2cfbe31d..4adc5c46c 100644 --- a/src/test/java/cz/cvut/kbss/termit/environment/Generator.java +++ b/src/test/java/cz/cvut/kbss/termit/environment/Generator.java @@ -51,6 +51,7 @@ import cz.cvut.kbss.termit.model.resource.File; import cz.cvut.kbss.termit.model.resource.Resource; import cz.cvut.kbss.termit.model.selector.TextQuoteSelector; +import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.util.Utils; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.repository.Repository; @@ -479,8 +480,7 @@ public static void simulateInferredSkosRelationship(AbstractTerm source, Collect public static UserGroup generateUserGroup() { final UserGroup group = new UserGroup(); - group.setUri( - URI.create(cz.cvut.kbss.termit.util.Vocabulary.s_c_Usergroup + "_instance" + Generator.randomInt())); + group.setUri(IdentifierResolver.generateSyntheticIdentifier(cz.cvut.kbss.termit.util.Vocabulary.s_c_sioc_Usergroup)); group.setLabel(UserGroup.class.getSimpleName() + Generator.randomInt()); return group; } diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java index 5529bd961..033169c3b 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java @@ -88,7 +88,9 @@ static void generateCanonicalContextReference(URI context, URI canonical, Entity final Repository repo = em.unwrap(Repository.class); try (final RepositoryConnection con = repo.getConnection()) { final ValueFactory vf = con.getValueFactory(); - con.add(vf.createIRI(context.toString()), vf.createIRI(cz.cvut.kbss.termit.util.Vocabulary.s_p_vychazi_z_verze), vf.createIRI(canonical.toString()), vf.createIRI(context.toString())); + con.add(vf.createIRI(context.toString()), + vf.createIRI(cz.cvut.kbss.termit.util.Vocabulary.s_p_d_sgov_pracovni_prostor_pojem_vychazi_z_verze), + vf.createIRI(canonical.toString()), vf.createIRI(context.toString())); } } diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDaoTest.java index 5886ac02e..a8f248411 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserGroupDaoTest.java @@ -55,7 +55,7 @@ void persistSavesEntitiesInCorrectContext() { assertTrue(em.createNativeQuery("ASK WHERE { GRAPH ?ctx { ?x a ?type . } }", Boolean.class) .setParameter("ctx", URI.create(StaticContexts.USER_GROUPS)) .setParameter("x", group) - .setParameter("type", URI.create(Vocabulary.s_c_Usergroup)).getSingleResult()); + .setParameter("type", URI.create(Vocabulary.s_c_sioc_Usergroup)).getSingleResult()); assertTrue(sut.find(group.getUri()).isPresent()); } } diff --git a/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java index 6e40f3a42..a623543f7 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java @@ -49,7 +49,7 @@ class CommentControllerTest extends BaseControllerTestRunner { private static final String PATH = "/comments/"; - private static final String NAMESPACE = Vocabulary.ONTOLOGY_IRI_glosar + "/comments/"; + private static final String NAMESPACE = Vocabulary.ONTOLOGY_IRI_GLOSAR + "/comments/"; private static final String NAME = "Comment_" + Generator.randomInt(); @Mock diff --git a/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java index 67fa6583f..374738295 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java @@ -257,7 +257,7 @@ void getSubTermsReturnsEmptyListForTermWithoutSubTerms() throws Exception { void getTermReturnsTermWithUnmappedProperties() throws Exception { final URI termUri = initTermUriResolution(); final Term term = Generator.generateTerm(); - final String customProperty = Vocabulary.s_p_has_dataset; + final String customProperty = Vocabulary.s_p_ddo_has_dataset; final String value = "Test"; term.setProperties(Collections.singletonMap(customProperty, Collections.singleton(value))); term.setUri(termUri); @@ -977,7 +977,7 @@ void addCommentReturnsLocationHeaderWithGeneratedIdentifier() throws Exception { when(termServiceMock.findRequired(term.getUri())).thenReturn(term); final Comment comment = generateComment(null, null); final String name = "comment-12345"; - final String namespace = Vocabulary.ONTOLOGY_IRI_glosar + "/comment/"; + final String namespace = Vocabulary.ONTOLOGY_IRI_GLOSAR + "/comment/"; comment.setUri(URI.create(namespace + name)); final MvcResult mvcResult = mockMvc @@ -1017,7 +1017,7 @@ void addCommentStandaloneReturnsLocationHeaderWithGeneratedIdentifier() throws E when(termServiceMock.findRequired(term.getUri())).thenReturn(term); final Comment comment = generateComment(null, null); final String name = "comment-12345"; - final String namespace = Vocabulary.ONTOLOGY_IRI_glosar + "/comment/"; + final String namespace = Vocabulary.ONTOLOGY_IRI_GLOSAR + "/comment/"; comment.setUri(URI.create(namespace + name)); final MvcResult mvcResult = mockMvc diff --git a/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java index 19a3ce6f5..62a261d88 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java @@ -161,10 +161,10 @@ void changeRoleUsesProvidedNamespaceToResolveUserUri() throws Exception { when(userService.findRequired(user.getUri())).thenReturn(user); mockMvc.perform(put(BASE_URL + "/" + extractIdentifierFragment(user.getUri()) + "/role") .queryParam(Constants.QueryParams.NAMESPACE, namespace) - .content(Vocabulary.s_c_omezeny_uzivatel).contentType(MediaType.TEXT_PLAIN)) + .content(Vocabulary.s_c_omezeny_uzivatel_termitu).contentType(MediaType.TEXT_PLAIN)) .andExpect(status().isNoContent()); verify(idResolverMock).resolveIdentifier(namespace, extractIdentifierFragment(user.getUri())); - verify(userService).changeRole(user, Vocabulary.s_c_omezeny_uzivatel); + verify(userService).changeRole(user, Vocabulary.s_c_omezeny_uzivatel_termitu); } @Test diff --git a/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java b/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java index 534723d2f..10a22cf7a 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java @@ -283,7 +283,7 @@ void generateIdentifierPreservesCzechAccentsAndAdornments() { @Test void generateSyntheticIdentifierGeneratesIdentifierForBaseContainingHash() { - final String base = Vocabulary.s_c_Usergroup; + final String base = Vocabulary.s_c_sioc_Usergroup; assertThat(base, containsString("#")); final URI result = IdentifierResolver.generateSyntheticIdentifier(base); assertThat(result.toString(), containsString(base)); diff --git a/src/test/java/cz/cvut/kbss/termit/service/business/AssetServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/business/AssetServiceTest.java index 34bb4f48e..517bfa3cb 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/business/AssetServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/business/AssetServiceTest.java @@ -96,7 +96,7 @@ private List generateRecentlyModifiedAssets(int count) { final Resource resource = Generator.generateResourceWithId(); rma = new RecentlyModifiedAsset(resource.getUri(), resource.getLabel(), Utils.timestamp(), author.getUri(), null, - Vocabulary.s_c_resource, + Vocabulary.s_c_ddo_resource, Vocabulary.s_c_vytvoreni_entity); } case 1 -> { diff --git a/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java b/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java index 2196997dd..d4319c359 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java @@ -179,7 +179,7 @@ private void insertAdditionalGlossaryData() { conn.add(glossaryIri(vocabulary), vf.createIRI("http://purl.org/vocab/vann/preferredNamespacePrefix"), vf.createLiteral("termit:"), vf.createIRI(vocabulary.getUri().toString())); conn.add(glossaryIri(vocabulary), vf.createIRI("http://purl.org/vocab/vann/preferredNamespaceUri"), - vf.createIRI(cz.cvut.kbss.termit.util.Vocabulary.ONTOLOGY_IRI_termit), + vf.createIRI(cz.cvut.kbss.termit.util.Vocabulary.ONTOLOGY_IRI_TERMIT), vf.createIRI(vocabulary.getUri().toString())); conn.add(glossaryIri(vocabulary), DCTERMS.RIGHTS, vf.createIRI("https://creativecommons.org/licenses/by-nc-nd/4.0"), diff --git a/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java b/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java index 1beaa0c60..43e8a362a 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java @@ -50,7 +50,7 @@ @ExtendWith(MockitoExtension.class) class AdminAccountGeneratorTest { - private static final URI ADMIN_URI = URI.create(Vocabulary.ONTOLOGY_IRI_termit + "/system-admin-user"); + private static final URI ADMIN_URI = URI.create(Vocabulary.ONTOLOGY_IRI_TERMIT + "/system-admin-user"); @Spy private Configuration config = new Configuration(); diff --git a/src/test/java/cz/cvut/kbss/termit/util/VocabularyTest.java b/src/test/java/cz/cvut/kbss/termit/util/VocabularyTest.java index 9c015ddaf..a35fd6534 100644 --- a/src/test/java/cz/cvut/kbss/termit/util/VocabularyTest.java +++ b/src/test/java/cz/cvut/kbss/termit/util/VocabularyTest.java @@ -25,6 +25,6 @@ public class VocabularyTest { @Test // @todo until https://github.com/kbss-cvut/jopa/issues/85 is resolved public void ensureContentHasCorrectUrl() { - Assert.equals("http://rdfs.org/sioc/ns#content", Vocabulary.s_p_content_A); + Assert.equals("http://rdfs.org/sioc/ns#content", Vocabulary.s_p_sioc_content); } }