Skip to content

Commit

Permalink
Merge pull request #261 from kbss-cvut/development
Browse files Browse the repository at this point in the history
[3.0.3] Release
  • Loading branch information
ledsoft authored Mar 16, 2024
2 parents 8c33cba + a8d83bd commit e427b5d
Show file tree
Hide file tree
Showing 86 changed files with 923 additions and 442 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN mvn -B de.qaware.maven:go-offline-maven-plugin:resolve-dependencies

COPY ontology ontology
COPY profile profile
COPY jopa-config jopa-config
COPY src src

RUN mvn package -B -P graphdb,standalone -DskipTests=true
Expand Down
2 changes: 1 addition & 1 deletion header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TermIt
Copyright (C) 2023 Czech Technical University in Prague
Copyright (C) 2024 Czech Technical University in Prague

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/mapping → jopa-config/mapping
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions jopa-config/prefixes
Original file line number Diff line number Diff line change
@@ -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
44 changes: 32 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.5</version>
<version>3.2.3</version>
</parent>

<artifactId>termit</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
<name>TermIt</name>
<description>Terminology manager based on Semantic Web technologies.</description>
<packaging>${packaging}</packaging>
Expand All @@ -21,15 +21,37 @@
<id>kbss</id>
<url>https://kbss.felk.cvut.cz/m2repo</url>
</repository>
<repository>
<id>central-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<properties>
<java.version>17</java.version>
<org.apache.tika.tika-core.version>2.7.0</org.apache.tika.tika-core.version>
<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
<org.springdoc.version>2.2.0</org.springdoc.version>
<cz.cvut.kbss.jopa.version>1.1.4</cz.cvut.kbss.jopa.version>
<cz.cvut.kbss.jsonld.version>0.14.0</cz.cvut.kbss.jsonld.version>
<cz.cvut.kbss.jopa.version>2.0.0-SNAPSHOT</cz.cvut.kbss.jopa.version>
<cz.cvut.kbss.jsonld.version>0.14.2</cz.cvut.kbss.jsonld.version>
<org.aspectj.version>1.9.20</org.aspectj.version>

<!-- Default value for deployment type property which should otherwise specified on command line -->
Expand Down Expand Up @@ -110,15 +132,14 @@
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-rio-rdfxml</artifactId>
<version>4.3.7</version>
<version>4.3.8</version>
</dependency>


<!-- Spring declarative transactions with JOPA -->
<dependency>
<groupId>com.github.ledsoft</groupId>
<artifactId>jopa-spring-transaction</artifactId>
<version>0.2.0</version>
<version>0.3.0-SNAPSHOT</version>
</dependency>

<!-- Spring -->
Expand Down Expand Up @@ -394,6 +415,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<parameters>true</parameters>
<annotationProcessorPaths>
<path>
<groupId>org.hibernate.validator</groupId>
Expand All @@ -419,15 +441,12 @@
<source>${java.version}</source>
<target>${java.version}</target>
<aspectLibraries>
<aspectLibrary>
<groupId>cz.cvut.kbss.jopa</groupId>
<artifactId>jopa-impl</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<parameters>true</parameters>
</configuration>
<dependencies>
<dependency>
Expand Down Expand Up @@ -482,10 +501,11 @@
<package>cz.cvut.kbss.termit.util</package>
<output-directory>${project.basedir}/src/main/generated-sources</output-directory>
<ontology-iri>http://onto.fel.cvut.cz/ontologies/application/termit</ontology-iri>
<mapping-file>${project.basedir}/src/main/resources/mapping</mapping-file>
<mapping-file>${project.basedir}/jopa-config/mapping</mapping-file>
<whole-ontology-as-ics>true</whole-ontology-as-ics>
<vocabulary-only>true</vocabulary-only>
<ignore-failed-imports>true</ignore-failed-imports>
<prefix-mapping-file>${project.basedir}/jopa-config/prefixes</prefix-mapping-file>
</configuration>
</execution>
<execution>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/cz/cvut/kbss/termit/dto/TermInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof TermInfo)) {
if (!(o instanceof TermInfo termInfo)) {
return false;
}
TermInfo termInfo = (TermInfo) o;
return Objects.equals(uri, termInfo.uri);
}

Expand All @@ -147,6 +146,6 @@ public int hashCode() {

@Override
public String toString() {
return "TermInfo{" + label + "<" + uri + ">" + '}';
return "TermInfo{" + label + " " + Utils.uriToString(uri) + '}';
}
}
50 changes: 48 additions & 2 deletions src/main/java/cz/cvut/kbss/termit/dto/listing/DocumentDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,60 @@
*/
package cz.cvut.kbss.termit.dto.listing;

import cz.cvut.kbss.jopa.model.annotations.Id;
import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty;
import cz.cvut.kbss.jopa.model.annotations.util.NonEntity;
import cz.cvut.kbss.jopa.vocabulary.DC;
import cz.cvut.kbss.jsonld.annotation.JsonLdAttributeOrder;
import cz.cvut.kbss.termit.model.resource.Resource;
import cz.cvut.kbss.termit.util.Utils;
import cz.cvut.kbss.termit.util.Vocabulary;

import java.net.URI;

@NonEntity
@OWLClass(iri = Vocabulary.s_c_dokument)
@JsonLdAttributeOrder({"uri", "label", "description", "files"})
public class DocumentDto extends Resource {
public class DocumentDto {

@Id
private URI uri;

@OWLAnnotationProperty(iri = DC.Terms.TITLE)
private String label;

@OWLDataProperty(iri = DC.Terms.DESCRIPTION)
private String description;

public URI getUri() {
return uri;
}

public void setUri(URI uri) {
this.uri = uri;
}

public String getLabel() {
return label;
}

public void setLabel(String label) {
this.label = label;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

@Override
public String toString() {
return "DocumentDto{" + label +
" " + Utils.uriToString(uri) +
'}';
}
}
16 changes: 8 additions & 8 deletions src/main/java/cz/cvut/kbss/termit/dto/listing/VocabularyDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package cz.cvut.kbss.termit.dto.listing;

import cz.cvut.kbss.jopa.model.MultilingualString;
import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty;
Expand All @@ -36,10 +37,10 @@
public class VocabularyDto extends AbstractEntity {

@OWLAnnotationProperty(iri = DC.Terms.TITLE)
private String label;
private MultilingualString label;

@OWLAnnotationProperty(iri = DC.Terms.DESCRIPTION)
private String description;
private MultilingualString description;

@OWLObjectProperty(iri = cz.cvut.kbss.termit.util.Vocabulary.s_p_importuje_slovnik)
private Set<URI> importedVocabularies;
Expand All @@ -50,19 +51,19 @@ public class VocabularyDto extends AbstractEntity {
@Types
private Set<String> types;

public String getLabel() {
public MultilingualString getLabel() {
return label;
}

public void setLabel(String label) {
public void setLabel(MultilingualString label) {
this.label = label;
}

public String getDescription() {
public MultilingualString getDescription() {
return description;
}

public void setDescription(String description) {
public void setDescription(MultilingualString description) {
this.description = description;
}

Expand Down Expand Up @@ -95,10 +96,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof VocabularyDto)) {
if (!(o instanceof VocabularyDto that)) {
return false;
}
VocabularyDto that = (VocabularyDto) o;
return Objects.equals(getUri(), that.getUri());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public void visitTerm(AbstractTerm term) {
@Override
public void visitVocabulary(Vocabulary vocabulary) {
this.rdfsResource = new RdfsResource(vocabulary.getUri(),
MultilingualString.create(vocabulary.getLabel(), language),
vocabulary.getDescription() != null ?
MultilingualString.create(vocabulary.getDescription(), language) : null,
vocabulary.getLabel(),
vocabulary.getDescription(),
cz.cvut.kbss.termit.util.Vocabulary.s_c_slovnik);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private <T extends AccessControlAgent> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package cz.cvut.kbss.termit.dto.readonly;

import cz.cvut.kbss.jopa.model.MultilingualString;
import cz.cvut.kbss.jopa.model.annotations.FetchType;
import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty;
import cz.cvut.kbss.jopa.model.annotations.OWLClass;
Expand All @@ -36,13 +37,13 @@
import static cz.cvut.kbss.termit.util.Utils.uriToString;

@OWLClass(iri = Vocabulary.s_c_slovnik)
public class ReadOnlyVocabulary extends Asset<String> implements HasIdentifier, Serializable {
public class ReadOnlyVocabulary extends Asset<MultilingualString> implements HasIdentifier, Serializable {

@OWLAnnotationProperty(iri = DC.Terms.TITLE)
private String label;
private MultilingualString label;

@OWLAnnotationProperty(iri = DC.Terms.DESCRIPTION)
private String description;
private MultilingualString description;

@OWLObjectProperty(iri = Vocabulary.s_p_importuje_slovnik, fetch = FetchType.EAGER)
private Set<URI> importedVocabularies;
Expand Down Expand Up @@ -71,19 +72,19 @@ public ReadOnlyVocabulary(VocabularyDto vocabularyDto) {
}
}

public String getLabel() {
public MultilingualString getLabel() {
return label;
}

public void setLabel(String label) {
public void setLabel(MultilingualString label) {
this.label = label;
}

public String getDescription() {
public MultilingualString getDescription() {
return description;
}

public void setDescription(String description) {
public void setDescription(MultilingualString description) {
this.description = description;
}

Expand All @@ -100,10 +101,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ReadOnlyVocabulary)) {
if (!(o instanceof ReadOnlyVocabulary that)) {
return false;
}
ReadOnlyVocabulary that = (ReadOnlyVocabulary) o;
return Objects.equals(getUri(), that.getUri());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/cz/cvut/kbss/termit/model/AbstractTerm.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
Loading

0 comments on commit e427b5d

Please sign in to comment.