Commit c1805c1f authored by Matthias Betz's avatar Matthias Betz
Browse files

switch to quality ade 1.0.0

added bridge constructive elements
fixed bridge related bugs
parent 259cbe7d
Pipeline #7238 failed with stage
in 17 seconds
......@@ -25,6 +25,7 @@ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.citygml4j.core.ade.ADEException;
import org.citygml4j.core.model.core.AbstractFeatureProperty;
......@@ -157,6 +158,8 @@ public class CityDoctorModelTest {
CityDoctorModel model = new CityDoctorModel(config, f);
CityModel cModel = new CityModel();
ValidationPlan plan = new ValidationPlan();
plan.setId("CD_PLAN_" + UUID.randomUUID().toString());
cModel.getFeatureMembers().add(new AbstractFeatureProperty(plan));
GlobalParameters globParams = new GlobalParameters();
plan.setGlobalParameters(new GlobalParametersProperty(globParams));
plan.getGlobalParameters().getObject().getParameters().add(new ParameterProperty(new Parameter()));
......@@ -214,11 +217,16 @@ public class CityDoctorModelTest {
List<CityObjectProperties> props = parsedBuilding.getGmlObject().getADEProperties(CityObjectProperties.class);
assertEquals(1, props.size());
List<AbstractFeatureProperty> featureMembers = parsedModel.getCityModel().getFeatureMembers();
assertEquals(1, featureMembers.size());
Validation val = (Validation) featureMembers.get(0).getObject();
assertEquals(2, featureMembers.size());
Validation val = (Validation) featureMembers.get(1).getObject();
de.hft.stuttgart.quality.model.types.Error errorStatistics = val.getStatistics().getObject().getErrors().get(0).getObject();
assertEquals(de.hft.stuttgart.quality.model.enums.ErrorId.GE_P_HOLE_OUTSIDE, errorStatistics.getName());
assertEquals(1, errorStatistics.getOccurrences());
ValidationPlan resultPlan = (ValidationPlan) featureMembers.get(0).getObject();
assertEquals(val.getValidationPlan().getHref().substring(1), resultPlan.getId());
}
@Test
......
......@@ -5,10 +5,10 @@
<pattern>
<rule context="//*:Building">
<assert test="count(descendant::*:lod1Solid) &gt; 0 or count(descendant::*:lod2Solid) &gt; 0 or count(descendant::*:lod3Solid) &gt; 0 or count(descendant::*:lod4Solid) &gt; 0"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||lodXsolid||false</assert>
<assert test="count(descendant::*:lod1Solid) &gt; 0 or count(descendant::*:lod2Solid) &gt; 0 or count(descendant::*:lod3Solid) &gt; 0 or count(descendant::*:lod4Solid) &gt; 0"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
<rule context="//*:BuildingPart">
<assert test="count(*:lod1Solid) = 1 or count(*:lod2Solid) = 1 or count(*:lod3Solid) = 1 or count(*:lod4Solid) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||lodXsolid||false</assert>
<assert test="count(*:lod1Solid) = 1 or count(*:lod2Solid) = 1 or count(*:lod3Solid) = 1 or count(*:lod4Solid) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
</pattern>
</schema>
......@@ -5,7 +5,7 @@
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.12.0</version>
<version>3.13.0</version>
</parent>
<artifactId>CityDoctorValidation</artifactId>
<name>CityDoctorValidation</name>
......
......@@ -5,10 +5,10 @@
<pattern>
<rule context="//*:Building">
<assert test="count(descendant::*:lod1Solid) &gt; 0 or count(descendant::*:lod2Solid) &gt; 0 or count(descendant::*:lod3Solid) &gt; 0 or count(descendant::*:lod4Solid) &gt; 0"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||any solid||false</assert>
<assert test="count(descendant::*:lod1Solid) &gt; 0 or count(descendant::*:lod2Solid) &gt; 0 or count(descendant::*:lod3Solid) &gt; 0 or count(descendant::*:lod4Solid) &gt; 0"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
<rule context="//*:BuildingPart">
<assert test="count(*:lod1Solid) = 1 or count(*:lod2Solid) = 1 or count(*:lod3Solid) = 1 or count(*:lod4Solid) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||any solid||false</assert>
<assert test="count(*:lod1Solid) = 1 or count(*:lod2Solid) = 1 or count(*:lod3Solid) = 1 or count(*:lod4Solid) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
</pattern>
</schema>
......@@ -50,6 +50,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;
import de.hft.stuttgart.citydoctor2.check.error.AttributeInvalidError;
import de.hft.stuttgart.citydoctor2.check.error.AttributeMissingError;
import de.hft.stuttgart.citydoctor2.check.error.AttributeValueWrongError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
......@@ -233,9 +234,11 @@ public class Checker {
for (SchematronError se : v) {
CheckError err;
if (AttributeMissingError.ID.getIdString().equals(se.getErrorIdString())) {
err = new AttributeMissingError(co, se.getChildId(), se.getNameOfAttribute(), se.isGeneric());
err = new AttributeMissingError(co, se.getChildId(), se.getNameOfAttribute());
} else if (AttributeValueWrongError.ID.getIdString().equals(se.getErrorIdString())) {
err = new AttributeValueWrongError(co, se.getChildId(), se.getNameOfAttribute(), se.isGeneric());
err = new AttributeValueWrongError(co, se.getChildId(), se.getNameOfAttribute());
} else if (AttributeInvalidError.ID.getIdString().equals(se.getErrorIdString())) {
err = new AttributeInvalidError(co, se.getChildId(), se.getNameOfAttribute());
} else {
throw new IllegalStateException(
"Unknown error ID was given in schematron file: " + se.getErrorIdString());
......@@ -316,7 +319,7 @@ public class Checker {
}
private de.hft.stuttgart.quality.model.types.Filter createFilter() {
var filter = new de.hft.stuttgart.quality.model.types.Filter();
var filter = new de.hft.stuttgart.quality.model.types.Filter();
handleInputFilter(filter);
if (excludeFilters != null) {
for (Filter f : excludeFilters) {
......@@ -364,11 +367,11 @@ public class Checker {
Checking buildingChecking = new Checking();
buildingChecking.setFeatureType(TopLevelFeatureType.BUILDING);
filter.getChecking().add(new CheckingProperty(buildingChecking));
Checking bridgeChecking = new Checking();
bridgeChecking.setFeatureType(TopLevelFeatureType.BRIDGE);
filter.getChecking().add(new CheckingProperty(bridgeChecking));
Checking landChecking = new Checking();
landChecking.setFeatureType(TopLevelFeatureType.LAND);
filter.getChecking().add(new CheckingProperty(landChecking));
......
......@@ -34,6 +34,7 @@ import org.apache.logging.log4j.Logger;
import org.citygml4j.core.model.core.AbstractFeatureProperty;
import org.citygml4j.core.model.core.CityModel;
import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.base.Reference;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.checks.SvrlContentHandler;
......@@ -53,10 +54,10 @@ import de.hft.stuttgart.citydoctor2.utils.QualityADEUtils;
import de.hft.stuttgart.quality.model.properties.ErrorProperty;
import de.hft.stuttgart.quality.model.properties.FeatureStatisticsProperty;
import de.hft.stuttgart.quality.model.properties.StatisticsProperty;
import de.hft.stuttgart.quality.model.properties.ValidationPlanProperty;
import de.hft.stuttgart.quality.model.types.FeatureStatistics;
import de.hft.stuttgart.quality.model.types.Statistics;
import de.hft.stuttgart.quality.model.types.Validation;
import de.hft.stuttgart.quality.model.types.ValidationPlan;
public class StreamCityGmlConsumer implements CityGmlConsumer {
......@@ -180,7 +181,11 @@ public class StreamCityGmlConsumer implements CityGmlConsumer {
statistics.getErrors().add(new ErrorProperty(stats));
}
val.setStatistics(new StatisticsProperty(statistics));
val.setValidationPlan(new ValidationPlanProperty(c.createValidationPlan()));
ValidationPlan validationPlan = c.createValidationPlan();
validationPlan.setId("CD_PLAN_" + UUID.randomUUID().toString());
cm.getFeatureMembers().add(new AbstractFeatureProperty(validationPlan));
val.setValidationPlan(new Reference(validationPlan));
cm.getFeatureMembers().add(new AbstractFeatureProperty(val));
}
......
......@@ -105,7 +105,7 @@ public class SvrlContentHandler implements ContentHandler {
if (nextIsTextContent && "text".equals(localName)) {
String text = buffer.toString();
String[] split = text.split("\\|\\|");
if (split.length != 5) {
if (split.length != 4) {
throw new IllegalStateException(
"Schematron File is not formed according to specification for CityDoctor.");
}
......@@ -113,8 +113,7 @@ public class SvrlContentHandler implements ContentHandler {
String childId = split[1];
String errorId = split[2];
String nameOfAttribute = split[3];
boolean generic = Boolean.parseBoolean(split[4]);
SchematronError err = new SchematronError(errorId, gmlId, childId, nameOfAttribute, generic);
SchematronError err = new SchematronError(errorId, gmlId, childId, nameOfAttribute);
if (gmlId == null || gmlId.isEmpty()) {
// general error
generalErrors.add(err);
......
......@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.12.0</version>
<version>3.13.0</version>
<packaging>pom</packaging>
<name>CityDoctorParent</name>
......@@ -10,6 +10,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<log4j.version>2.18.0</log4j.version>
<revision>${project.version}</revision>
<nonMavenLibsPath>${project.baseUri}../non-maven-libs</nonMavenLibsPath>
</properties>
......@@ -42,6 +43,22 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-swing -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorModel</artifactId>
......@@ -102,7 +119,7 @@
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>citygml4j-quality-ade</artifactId>
<version>3.1.4</version>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
<dependency>
......@@ -144,13 +161,13 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.2</version>
<version>${log4j.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.2</version>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
......@@ -161,7 +178,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
<version>2.17.2</version>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.locationtech.proj4j</groupId>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment