Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kbss-cvut/owldiff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: psiotwo/owldiff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Sep 6, 2022

  1. status badge

    psiotwo authored Sep 6, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cbb51ec View commit details
  2. Update pom.xml

    psiotwo authored Sep 6, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8629614 View commit details
  3. Update maven.yml

    psiotwo authored Sep 6, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2679f94 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0727f6d View commit details
  5. Update README.md

    psiotwo authored Sep 6, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5c63304 View commit details

Commits on Sep 12, 2022

  1. Update README.md

    psiotwo authored Sep 12, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6072502 View commit details

Commits on Sep 21, 2022

  1. Create maven-publish.yml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cf990ce View commit details
  2. Release 0.2.1

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    918a013 View commit details
  3. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7d73c20 View commit details
  4. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8660705 View commit details
  5. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    758eddf View commit details
  6. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1733577 View commit details
  7. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2e7e958 View commit details
  8. Update maven-publish.yml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    56ca828 View commit details
  9. Update maven-publish.yml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3744662 View commit details
  10. Update maven-publish.yml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    21a924b View commit details
  11. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1ec2d85 View commit details
  12. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    da23344 View commit details
  13. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c587fc8 View commit details
  14. Update pom.xml

    psiotwo authored Sep 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    de78c3c View commit details

Commits on Nov 14, 2022

  1. Copy the full SHA
    dcf9d18 View commit details
  2. Copy the full SHA
    17e952e View commit details
  3. Code cleanup

    psiotwo committed Nov 14, 2022
    Copy the full SHA
    2016cfc View commit details
  4. JUnit 4 -> Jupiter (5)

    psiotwo committed Nov 14, 2022
    Copy the full SHA
    22e42f1 View commit details
  5. cleanup

    psiotwo committed Nov 14, 2022
    Copy the full SHA
    0dbe9e3 View commit details

Commits on Nov 15, 2022

  1. Copy the full SHA
    c64ff01 View commit details

Commits on Jan 31, 2024

  1. Copy the full SHA
    3cba81e View commit details
  2. Merge pull request #1 from psiotwo/fix/cleanup-dependencies

    fix: clean-up of dependencies.
    psiotwo authored Jan 31, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8206daf View commit details
35 changes: 35 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v2
with:
java-version: '14'
distribution: 'adopt'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 14
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '14'
distribution: 'adopt'
cache: maven
- name: Build with Maven
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# OWLDiff
# OWLDiff [![Java CI with Maven](https://github.com/psiotwo/owldiff/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/psiotwo/owldiff/actions/workflows/maven.yml)

A tool to perform a 2-way diff of OWL ontologies.

## Requirements
- Java 14

## Run
In order to run OWLDiff run `mvn clean install` and
- for CLI: `cd owldiff-cli && mvn assembly:assembly` to create an executable JAR file in `target/owldiff-cli-<VERSION>-jar-with-dependencies.jar`
- for Desktop UI: `cd owldiff-standalone && mvn assembly:assembly` to create a ZIP file`target/owldiff-standalone-<VERSION>-dist-bin.zip`. Unzip it and run `bin/owldiff`.

## Features
- syntactic diff/merge functionality
- explanations for inferred axioms
@@ -40,5 +45,10 @@ A tool to perform a 2-way diff of OWL ontologies.
- to perform the diff of file/URI <u1> and file/URI <u2> run
'java -jar owldiff.jar <u1> <u2>' (or the convenience script 'owldiff <u1> <u2>' on linux)

## Resources
- Kremen, P. & Šmíd, M. & Kouba, Z.. (2011). OWLDiff: A practical tool for comparison and merge of owl ontologies. Proceedings of the 10th International Workshop on Web Semantics. 229-233.
- Kremen, P. & Kouba, Z.. (2009). Incremental Approach to Error Explanations in Ontologies. Networked Knowledge - Networked Media - Integrating Knowledge Management 2009: 171-185


* * *
2020 Czech Technical University, Knowledge Based and Software Systems Group
22 changes: 10 additions & 12 deletions owldiff-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff-parent</artifactId>
<relativePath>../owldiff-parent/pom.xml</relativePath>
<version>0.2.1-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>owldiff-cli</artifactId>
@@ -33,31 +33,30 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
</dependency>
<dependency>
<groupId>com.github.rvesse</groupId>
<artifactId>airline</artifactId>
<version>2.8.0</version>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<index>true</index>
@@ -71,9 +70,8 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<version>3.6.0</version>
<configuration>
<archive>
<manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cz.cvut.kbss.owldiff.cli;

import cz.cvut.kbss.owldiff.change.OWLChangeType;

public class ChangeTypeUtils {

public static String changeTypeName(OWLChangeType ct) {
switch (ct) {
case SYNTACTIC_ORIG_REST:
return "-";
case SYNTACTIC_UPD_REST:
return "+";
case ENTAILEXPL_INFERRED:
case ENTAILEXPL_POSSIBLY_REMOVE:
case CEX_ISIN_DIFFR_DIFFL:
case CEX_ISIN_DIFFR:
case CEX_ISIN_DIFFL:
case HEURISTIC_SAME_SUB_AND_SUPER_CLASSES:
case HEURISTIC_SINGLE_UNMATCHED_SIBLING:
default:
throw new UnsupportedOperationException();
}
}
}
178 changes: 54 additions & 124 deletions owldiff-cli/src/main/java/cz/cvut/kbss/owldiff/cli/Diff.java
Original file line number Diff line number Diff line change
@@ -1,153 +1,83 @@
package cz.cvut.kbss.owldiff.cli;

import com.github.rvesse.airline.annotations.Arguments;
import com.github.rvesse.airline.annotations.Command;
import cz.cvut.kbss.owldiff.change.OWLChangeType;
import cz.cvut.kbss.owldiff.change.SyntacticAxiomChange;
import cz.cvut.kbss.owldiff.diff.syntactic.SyntacticDiff;
import cz.cvut.kbss.owldiff.diff.syntactic.SyntacticDiffOutput;
import cz.cvut.kbss.owldiff.ontology.OntologyHandler;
import cz.cvut.kbss.owldiff.syntax.ManchesterSyntax;
import lombok.extern.slf4j.Slf4j;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.io.IRIDocumentSource;
import org.semanticweb.owlapi.model.*;

import java.io.File;
import java.net.URI;
import java.text.MessageFormat;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Pattern;
import lombok.extern.slf4j.Slf4j;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.io.IRIDocumentSource;
import org.semanticweb.owlapi.io.OWLRendererException;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.MissingImportHandlingStrategy;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OntologyConfigurator;

import static cz.cvut.kbss.owldiff.cli.ChangeTypeUtils.changeTypeName;

@Slf4j
@Command(name = "diff")
public class Diff {

@Arguments(title = "File paths", description = "Path of the oldFile and newFile")
private List<String> paths;

public void run() throws OWLOntologyCreationException, OWLRendererException {
if (paths.size() != 2) {
log.error("Exactly two files must be provided, but got {0} only", paths.size());
return;
}

String oldFF = paths.get(0);
String newFF = paths.get(1);

URI oldF;
URI newF;
if (new File(oldFF).exists()) {
oldF = new File(oldFF).getAbsoluteFile().toURI();
} else {
log.error("File does not exist {}");
throw new RuntimeException();
}

if (new File(newFF).exists()) {
newF = new File(newFF).getAbsoluteFile().toURI();
} else {
log.error("File does not exist {}");
throw new RuntimeException();
}

if (oldF.isAbsolute() && newF.isAbsolute()) {
final OWLOntologyManager originalM = OWLManager
.createOWLOntologyManager();
originalM.setOntologyConfigurator(
new OntologyConfigurator()
.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT)
.setReportStackTraces(true)
.setStrict(false));
originalM.getIRIMappers().add( (ontologyIRI) -> {
if (Pattern.compile(oldFF).matcher(ontologyIRI.toString()).matches()) {
return ontologyIRI;
} else {
return IRI.create(String.format("file://%s", ontologyIRI.toString()));
}});
final OWLOntology originalO =
originalM.loadOntologyFromOntologyDocument(new IRIDocumentSource(
IRI.create(oldF)));

final OWLOntologyManager updateM = OWLManager.createOWLOntologyManager();
updateM.setOntologyConfigurator(new OntologyConfigurator().setMissingImportHandlingStrategy(
MissingImportHandlingStrategy.SILENT)
.setReportStackTraces(true)
.setStrict(false)
);
updateM.getIRIMappers().add( (ontologyIRI) -> {
if (Pattern.compile(newFF).matcher(ontologyIRI.toString()).matches()) {
return ontologyIRI;
} else {
return IRI.create(String.format("file://%s", ontologyIRI.toString()));
}});

OWLOntology updateO =
updateM.loadOntologyFromOntologyDocument(new IRIDocumentSource(IRI.create(newF)));
public void run(final String original, final String updated) throws OWLOntologyCreationException {
final OWLOntology originalO = createFreshOntology(original);
final OWLOntology updateO = createFreshOntology(updated);

SyntacticDiff d = new SyntacticDiff(new OntologyHandler() {
@Override public OWLOntology getOriginalOntology() {
return originalO;
}

@Override public OWLOntology getUpdateOntology() {
return updateO;
}
});
final SyntacticDiff d = new SyntacticDiff(new OntologyHandler() {
@Override
public OWLOntology getOriginalOntology() {
return originalO;
}

final SyntacticDiffOutput o = d.diff();
@Override
public OWLOntology getUpdateOntology() {
return updateO;
}
});

ManchesterSyntax s = new ManchesterSyntax();
o.getOWLChanges()
final SyntacticDiffOutput o = d.diff();
final ManchesterSyntax s = new ManchesterSyntax();
o.getOWLChanges()
.stream().sorted(
new ChangeComparator()
.thenComparing(SyntacticAxiomChange::getOWLChangeType))
new SyntacticChangeComparator())
.forEach(c ->
System.out.println(MessageFormat.format("{0} {1}", changeTypeName(c.getOWLChangeType()),
s.writeAxiom(c.getAxiom(), false, null, false)))
System.out.println(MessageFormat.format("{0} {1}",
changeTypeName(c.getOWLChangeType()),
s.writeAxiom(c.getAxiom(), false, null, false)))
);

} else {
log.error("Files are not absolute");
}
}

private class ChangeComparator implements Comparator<SyntacticAxiomChange> {

private MainOwlEntityResolver resolver;
private URI ensureFileExists(final String file) {
final File f = new File(file);

public ChangeComparator() {
this.resolver = new MainOwlEntityResolver();
if (!f.exists()) {
throw new IllegalArgumentException(MessageFormat.format("File \"{0}\" does not exist.", file));
} else if (!f.isAbsolute()) {
throw new IllegalArgumentException(MessageFormat.format("File \"{0}\" is not absolute.", file));
} else {
return f.getAbsoluteFile().toURI();
}
}

public int compare(SyntacticAxiomChange c1, SyntacticAxiomChange c2) {
c1.getAxiom().accept(resolver);
final IRI c1Iri = resolver.getEntity();

c2.getAxiom().accept(resolver);
final IRI c2Iri = resolver.getEntity();

if ( c1Iri != null && c1Iri.equals(c2Iri) ) {
return 0;
} else if (c1Iri != null && c2Iri != null) {
return c1Iri.compareTo(c2Iri);
} else {
return c1.getAxiom().compareTo(c2.getAxiom());
}
}
private OWLOntology createFreshOntology(final String original) throws OWLOntologyCreationException {
final OntologyConfigurator configurator = new OntologyConfigurator()
.setMissingImportHandlingStrategy(
MissingImportHandlingStrategy.SILENT)
.setReportStackTraces(true)
.setStrict(false);
final OWLOntologyManager originalM = OWLManager
.createOWLOntologyManager();
originalM.setOntologyConfigurator(configurator);
originalM.getIRIMappers().add(createIRIMapper(original));
return
originalM.loadOntologyFromOntologyDocument(new IRIDocumentSource(
IRI.create(ensureFileExists(original))));
}

private String changeTypeName(OWLChangeType ct) {
switch (ct) {
case SYNTACTIC_ORIG_REST: return "-";
case SYNTACTIC_UPD_REST: return "+";
default: throw new UnsupportedOperationException();
}
private OWLOntologyIRIMapper createIRIMapper(final String file) {
final Pattern p = Pattern.compile(file);
return (ontologyIRI) -> p.matcher(ontologyIRI.toString()).matches() ?
ontologyIRI :
IRI.create(String.format("file://%s", ontologyIRI));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cz.cvut.kbss.owldiff.cli;

import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;

import java.util.concurrent.Callable;

@Slf4j
@CommandLine.Command(name = "diff", mixinStandardHelpOptions = true,
description = "Compares OWL ontologies.")
public class DiffCommand implements Callable<Integer> {

@CommandLine.Parameters(description = "Original ontology file.")
private String original;

@CommandLine.Parameters(description = "Updated ontology file.")
private String updated;

public static void main(String[] args) {
new CommandLine(new DiffCommand()).execute(args);
}

public Integer call() {
try {
new Diff().run(original, updated);
} catch (Exception e) {
log.error("Exception during command execution: {}", e.getMessage());
log.debug("Details:", e);
return -1;
}
return 0;
}
}
33 changes: 0 additions & 33 deletions owldiff-cli/src/main/java/cz/cvut/kbss/owldiff/cli/GitDiff.java

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cz.cvut.kbss.owldiff.cli;

import cz.cvut.kbss.owldiff.change.SyntacticAxiomChange;
import org.semanticweb.owlapi.model.IRI;

import java.util.Comparator;

public class SyntacticChangeComparator implements Comparator<SyntacticAxiomChange> {

private IRI getIRI(SyntacticAxiomChange c) {
final MainOwlEntityResolver resolver = new MainOwlEntityResolver();
c.getAxiom().accept(resolver);
return resolver.getEntity();
}

public int compare(final SyntacticAxiomChange c1, final SyntacticAxiomChange c2) {
return Comparator.nullsFirst((cx1, cx2) -> {
final SyntacticAxiomChange cc1 = (SyntacticAxiomChange) cx1;
final SyntacticAxiomChange cc2 = (SyntacticAxiomChange) cx2;
// Compare entities first
int c = Comparator.nullsFirst(IRI::compareTo).compare(getIRI(cc1), getIRI(cc2));
// ... then axioms inside these entities.
return c != 0 ? c : cc1.getAxiom().compareTo(cc2.getAxiom());
}).compare(c1, c2);
}
}
2 changes: 1 addition & 1 deletion owldiff-cli/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
</layout>
</appender>

<logger name="cz.cvut.kbss" level="info" additivity="false">
<logger name="cz.cvut.kbss" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>

48 changes: 21 additions & 27 deletions owldiff-core/pom.xml
Original file line number Diff line number Diff line change
@@ -17,13 +17,29 @@
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff-parent</artifactId>
<relativePath>../owldiff-parent/pom.xml</relativePath>
<version>0.2.1-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>owldiff-core</artifactId>
<packaging>jar</packaging>
<name>OWLDiff Core Library</name>

<dependencies>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
</dependency>
<dependency>
<groupId>cz.cvut.kbss</groupId>
<artifactId>explanations</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<resources>
<resource>
@@ -33,17 +49,15 @@
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
@@ -54,9 +68,8 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<version>3.6.0</version>
<configuration>
<descriptors>
<descriptor>
@@ -69,9 +82,8 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
@@ -88,22 +100,4 @@
<extensions>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>5.1.16</version>
</dependency>
<dependency>
<groupId>cz.cvut.kbss</groupId>
<artifactId>explanations</artifactId>
<version>0.91</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -17,76 +17,59 @@
import cz.cvut.kbss.owldiff.diff.OWLDiff;
import cz.cvut.kbss.owldiff.diff.OWLDiffOutput;
import cz.cvut.kbss.owldiff.ontology.OntologyHandler;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.*;

import java.util.Set;

/**
* Created with IntelliJ IDEA.
* User: kremep1
* Date: 10/3/12
* Time: 8:01 AM
* To change this template use File | Settings | File Templates.
*/
public class SyntacticDiffTest {

OntologyHandler h;
private static final String iri = "http://kbss.felk.cvut.cz/ontologies/2012/owldiff-test-syntactic.owl";
private static final String ns = iri + "#";

@Before
public void setUp() throws Exception {
IRI iri = IRI.create("http://kbss.felk.cvut.cz/ontologies/2012/owldiff-test-syntactic.owl");
final OWLOntology o = OWLManager.createOWLOntologyManager().createOntology(iri);
final OWLDataFactory oF = o.getOWLOntologyManager().getOWLDataFactory();
final OWLClass oClassA1 = oF.getOWLClass(IRI.create(iri.toString() + "#A1"));
final OWLClass oClassA2 = oF.getOWLClass(IRI.create(iri.toString() + "#A2"));
final OWLObjectProperty oPropR = oF.getOWLObjectProperty(IRI.create(iri.toString() + "#R"));
@Test
public void testDiffBasic() throws Exception {

o.getOWLOntologyManager().addAxiom(o, oF.getOWLDeclarationAxiom(oClassA1));
o.getOWLOntologyManager().addAxiom(o, oF.getOWLDeclarationAxiom(oClassA2));
o.getOWLOntologyManager().addAxiom(o, oF.getOWLDeclarationAxiom(oPropR));
final OWLOntology o = OWLManager.createOWLOntologyManager().createOntology(IRI.create(iri));
final OWLDataFactory oF = o.getOWLOntologyManager().getOWLDataFactory();
final OWLClass oCA1 = oF.getOWLClass(ns, "A1");
final OWLClass oCA2 = oF.getOWLClass(ns, "A2");
final OWLObjectProperty oR = oF.getOWLObjectProperty(ns, "R");

o.getOWLOntologyManager().addAxiom(o, oF.getOWLSubClassOfAxiom(oClassA1, oF.getOWLObjectSomeValuesFrom(oPropR, oClassA2)));
final OWLOntologyManager om = o.getOWLOntologyManager();
om.addAxiom(o, oF.getOWLDeclarationAxiom(oCA1));
om.addAxiom(o, oF.getOWLDeclarationAxiom(oCA2));
om.addAxiom(o, oF.getOWLDeclarationAxiom(oR));
om.addAxiom(o, oF.getOWLSubClassOfAxiom(oCA1, oF.getOWLObjectSomeValuesFrom(oR, oCA2)));

final OWLOntology u = OWLManager.createOWLOntologyManager().createOntology(iri);
final OWLOntology u = OWLManager.createOWLOntologyManager().createOntology(IRI.create(iri));

final OWLDataFactory uF = o.getOWLOntologyManager().getOWLDataFactory();
final OWLClass uClassA1 = uF.getOWLClass(IRI.create(iri.toString() + "#A1"));
final OWLObjectProperty uPropR = uF.getOWLObjectProperty(IRI.create(iri.toString() + "#R"));

u.getOWLOntologyManager().addAxiom(u, uF.getOWLDeclarationAxiom(uClassA1));
u.getOWLOntologyManager().addAxiom(u, uF.getOWLDeclarationAxiom(uPropR));
final OWLClass uCA1 = uF.getOWLClass(ns, "A1");
final OWLObjectProperty uR = uF.getOWLObjectProperty(ns, "R");

u.getOWLOntologyManager().addAxiom(u, uF.getOWLSubClassOfAxiom(uClassA1, uF.getOWLObjectSomeValuesFrom(uPropR, uClassA1)));
u.getOWLOntologyManager().addAxiom(u, uF.getOWLSubClassOfAxiom(uClassA1, uF.getOWLThing()));
final OWLOntologyManager um = u.getOWLOntologyManager();
um.addAxiom(u, uF.getOWLDeclarationAxiom(uCA1));
um.addAxiom(u, uF.getOWLDeclarationAxiom(uR));
um.addAxiom(u, uF.getOWLSubClassOfAxiom(uCA1, uF.getOWLObjectSomeValuesFrom(uR, uCA1)));
um.addAxiom(u, uF.getOWLSubClassOfAxiom(uCA1, uF.getOWLThing()));


h = new OntologyHandler() {
final OWLDiff diff = new SyntacticDiff(new OntologyHandler() {
public OWLOntology getOriginalOntology() {
return o;
}

public OWLOntology getUpdateOntology() {
return u;
}
};
}

@After
public void tearDown() throws Exception {
}
});

@Test
public void testDiffBasic() throws Exception {
OWLDiff diff = new SyntacticDiff(h);
OWLDiffOutput diffOutput = diff.diff();
Set<? extends OWLChange> changes = diffOutput.getOWLChanges();
final OWLDiffOutput diffOutput = diff.diff();
final Set<? extends OWLChange> changes = diffOutput.getOWLChanges();

Assert.assertNotNull(changes);
Assert.assertEquals(changes.size(), 4);
Assertions.assertNotNull(changes);
Assertions.assertEquals(4, changes.size());
}
}
47 changes: 0 additions & 47 deletions owldiff-core/src/test/java/test/HangingHttpEndpoint.java

This file was deleted.

57 changes: 0 additions & 57 deletions owldiff-core/src/test/java/test/Test.java

This file was deleted.

65 changes: 0 additions & 65 deletions owldiff-core/src/test/java/test/TestCEX.java

This file was deleted.

79 changes: 0 additions & 79 deletions owldiff-core/src/test/java/test/TestExplanations.java

This file was deleted.

68 changes: 0 additions & 68 deletions owldiff-core/src/test/java/test/TestH1.java

This file was deleted.

78 changes: 70 additions & 8 deletions owldiff-parent/pom.xml
Original file line number Diff line number Diff line change
@@ -19,12 +19,12 @@
<artifactId>owldiff-parent</artifactId>
<packaging>pom</packaging>
<name>OWLDiff Parent POM</name>
<version>0.2.1-SNAPSHOT</version>
<version>0.2.1</version>
<repositories>
<repository>
<id>kbss</id>
<name>KBSS Maven 2 Repository</name>
<url>http://kbss.felk.cvut.cz/m2repo</url>
<url>https://kbss.felk.cvut.cz/m2repo</url>
</repository>
</repositories>
<developers>
@@ -48,7 +48,7 @@
</developer>
<developer>
<name>Peter Butka</name>
<email>peter. butka@gmail.com</email>
<email>peter.butka@gmail.com</email>
<organization>CVUT</organization>
</developer>
</developers>
@@ -69,27 +69,89 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.11.0</version>
<configuration>
<encoding>UTF-8</encoding>
<source>14</source>
<target>14</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.3</version>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.4.1</version>
<version>3.5.2</version>
</extension>
</extensions>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/psiotwo/owldiff</url>
</repository>
</distributionManagement>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>5.1.16</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.9.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.4.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.4</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.0</version>
</dependency>
<dependency>
<groupId>cz.cvut.kbss</groupId>
<artifactId>explanations</artifactId>
<version>0.91</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
56 changes: 26 additions & 30 deletions owldiff-standalone/pom.xml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff-parent</artifactId>
<relativePath>../owldiff-parent/pom.xml</relativePath>
<version>0.2.1-SNAPSHOT</version>
<version>0.2.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
@@ -34,12 +34,25 @@
</license>
</licenses>

<dependencies>
<dependency>
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.3</version>
<configuration>
<includes>
<include>**/*Test.java</include>
@@ -48,9 +61,8 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
<configuration>
<archive>
<index>true</index>
@@ -65,19 +77,19 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<version>3.6.0</version>
<configuration>
<descriptor>
src/main/assembly/zip-bin-descriptor.xml
</descriptor>
<descriptors>
<descriptor>
src/main/assembly/zip-bin-descriptor.xml
</descriptor>
</descriptors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.0</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
@@ -88,9 +100,8 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
@@ -104,27 +115,12 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
63 changes: 32 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -12,35 +12,36 @@
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff</artifactId>
<packaging>pom</packaging>
<name>OWLDiff</name>
<version>0.2.1-SNAPSHOT</version>
<description>OWLDiff - diff of OWL ontologies</description>
<distributionManagement>
<repository>
<id>kbss</id>
<url>http://kbss.felk.cvut.cz/var/www/m2repo</url>
</repository>
</distributionManagement>
<modules>
<module>owldiff-parent</module>
<module>owldiff-core</module>
<module>owldiff-cli</module>
<module>owldiff-standalone</module>
<module>owldiff-protege-plugin</module>
</modules>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.4.1</version>
</extension>
</extensions>
</build>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cz.cvut.kbss</groupId>
<artifactId>owldiff</artifactId>
<packaging>pom</packaging>
<name>OWLDiff</name>
<version>0.2.1</version>
<description>OWLDiff - diff of OWL ontologies</description>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/psiotwo/owldiff</url>
</repository>
</distributionManagement>
<modules>
<module>owldiff-parent</module>
<module>owldiff-core</module>
<module>owldiff-cli</module>
<module>owldiff-standalone</module>
<!--module>owldiff-protege-plugin</module-->
</modules>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.5.2</version>
</extension>
</extensions>
</build>
</project>