-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Domain/Range of inverse properties to same as the inverse.
Fixes #33
- Loading branch information
Showing
10 changed files
with
186 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/test/java/de/uni_stuttgart/vis/vowl/owl2vowl/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package de.uni_stuttgart.vis.vowl.owl2vowl; | ||
|
||
import org.semanticweb.owlapi.model.IRI; | ||
|
||
public class Constants { | ||
|
||
public static final String OWL2VOWL_NAMESPACE = "https://owl2vowl.de/"; | ||
|
||
public static IRI getIRIWithTestNamespace(String entityIRI) { | ||
return IRI.create(OWL2VOWL_NAMESPACE + entityIRI); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/test/java/de/uni_stuttgart/vis/vowl/owl2vowl/PropertyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package de.uni_stuttgart.vis.vowl.owl2vowl; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import de.uni_stuttgart.vis.vowl.owl2vowl.model.data.VowlData; | ||
import de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.properties.AbstractProperty; | ||
import org.junit.Test; | ||
|
||
|
||
public class PropertyTest { | ||
|
||
@Test | ||
public void shouldProcessAnonymousInverseRelationCorrectly() { | ||
TestConverter converter = new TestConverter(getClass().getResourceAsStream("/inverse-anonym-test.ttl")); | ||
VowlData data = converter.getConvertedData(); | ||
|
||
AbstractProperty propertyA = data.getPropertyForIri(Constants.getIRIWithTestNamespace("propertyA")); | ||
AbstractProperty propertyB = data.getPropertyForIri(Constants.getIRIWithTestNamespace("propertyB")); | ||
|
||
assertThat(propertyA.getJsonDomain(), is(Constants.getIRIWithTestNamespace("classA"))); | ||
assertThat(propertyA.getJsonRange(), is(Constants.getIRIWithTestNamespace("classB"))); | ||
|
||
assertThat(propertyB.getJsonDomain(), is(Constants.getIRIWithTestNamespace("classB"))); | ||
assertThat(propertyB.getJsonRange(), is(Constants.getIRIWithTestNamespace("classA"))); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/java/de/uni_stuttgart/vis/vowl/owl2vowl/TestConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package de.uni_stuttgart.vis.vowl.owl2vowl; | ||
|
||
import de.uni_stuttgart.vis.vowl.owl2vowl.converter.InputStreamConverter; | ||
import de.uni_stuttgart.vis.vowl.owl2vowl.model.data.VowlData; | ||
import java.io.InputStream; | ||
|
||
public class TestConverter extends InputStreamConverter { | ||
|
||
public TestConverter(InputStream ontology) { | ||
super(ontology); | ||
} | ||
|
||
public VowlData getConvertedData() { | ||
if (!this.initialized) { | ||
this.convert(); | ||
} | ||
return this.vowlData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#################################PREFIXES################################ | ||
|
||
@prefix : <https://owl2vowl.de/> . | ||
@prefix this: <https://owl2vowl.de/> . | ||
@prefix dcterms: <http://purl.org/dc/terms/> . | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix schema: <http://schema.org/> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
#################################ONTOLOGY################################# | ||
|
||
this:schema | ||
a owl:Ontology ; | ||
dcterms:title "OWL2VOWL Testing" ; | ||
. | ||
|
||
#################################ENTITIES################################## | ||
|
||
:propertyA | ||
a owl:ObjectProperty ; | ||
rdfs:domain :classA ; | ||
rdfs:range :classB ; | ||
. | ||
:propertyB | ||
owl:inverseOf :propertyA ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Configuration> | ||
<Properties> | ||
<Property name="PID">????</Property> | ||
<Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property> | ||
<Property name="LOG_LEVEL_PATTERN">%5p</Property> | ||
<Property name="CONSOLE_LOG_PATTERN">%clr{%d{yyyy-MM-dd HH:mm:ss.SSS}}{faint} %clr{${LOG_LEVEL_PATTERN}} %clr{${sys:PID}}{magenta} %clr{---}{faint} | ||
%clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD} | ||
</Property> | ||
<Property name="FILE_LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN} ${sys:PID} --- [%t] %-40.40c{1.} : | ||
%m%n${sys:LOG_EXCEPTION_CONVERSION_WORD} | ||
</Property> | ||
</Properties> | ||
<Appenders> | ||
<Console name="Console" target="SYSTEM_OUT" follow="true"> | ||
<PatternLayout pattern="${sys:CONSOLE_LOG_PATTERN}"/> | ||
</Console> | ||
</Appenders> | ||
<Loggers> | ||
<Logger name="org.apache.catalina.startup.DigesterFactory" level="error"/> | ||
<Logger name="org.apache.catalina.util.LifecycleBase" level="error"/> | ||
<Logger name="org.apache.coyote.http11.Http11NioProtocol" level="warn"/> | ||
<logger name="org.apache.sshd.common.util.SecurityUtils" level="warn"/> | ||
<Logger name="org.apache.tomcat.util.net.NioSelectorPool" level="warn"/> | ||
<Logger name="org.crsh.plugin" level="warn"/> | ||
<logger name="org.crsh.ssh" level="warn"/> | ||
<Logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="error"/> | ||
<Logger name="org.hibernate.validator.internal.util.Version" level="warn"/> | ||
<logger name="org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration" level="warn"/> | ||
<logger name="org.springframework.boot.actuate.endpoint.jmx" level="warn"/> | ||
<logger name="org.thymeleaf" level="warn"/> | ||
<logger name="de.uni_stuttgart.vis.vowl.owl2vowl" level="debug"/> | ||
<Root level="info"> | ||
<AppenderRef ref="Console"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |