Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.entur</groupId>
<artifactId>netex-validator-java</artifactId>
<version>10.1.1-SNAPSHOT</version>
<version>11.0.0-SNAPSHOT</version>

<name>netex-validator-java</name>
<description>Library for validating NeTEx datasets against the Nordic NeTEx Profile.</description>
Expand Down Expand Up @@ -54,8 +54,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>17</jdk.version>

<netex-java-model.version>2.0.15</netex-java-model.version>
<netex-parser-java.version>3.1.46</netex-parser-java.version>
<netex-java-model.version>2.0.16-SNAPSHOT</netex-java-model.version>
<netex-parser-java.version>4.0.0-SNAPSHOT</netex-parser-java.version>
<saxon.version>12.5</saxon.version>
<geotools.version>33.0</geotools.version>
<snakeyaml.version>2.4</snakeyaml.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ private Map<String, Set<String>> getAllowedSubstitutions() {
vehicleScheduleJourneyRefSubstitutions
);

Set<String> datedVehicleJourneyRefSubstitutions = new HashSet<>();
datedVehicleJourneyRefSubstitutions.add("DatedServiceJourney");
substitutions.put(
"DatedVehicleJourneyRef",
datedVehicleJourneyRefSubstitutions
);

Set<String> serviceJourneyPatternRefSubstitutions = new HashSet<>();
serviceJourneyPatternRefSubstitutions.add("ServiceJourneyPattern");
substitutions.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import jakarta.xml.bind.JAXBElement;
import javax.annotation.Nullable;
import org.rutebanken.netex.model.DatedServiceJourney;
import org.rutebanken.netex.model.DatedServiceJourneyRefStructure;
import org.rutebanken.netex.model.VersionOfObjectRefStructure;
import org.rutebanken.netex.model.VehicleJourneyRefStructure;

public class DatedServiceJourneyUtils {

Expand All @@ -18,12 +17,11 @@ public static String originalDatedServiceJourneyRef(
DatedServiceJourney datedServiceJourney
) {
return datedServiceJourney
.getJourneyRef()
.getReplacedJourneys()
.getDatedVehicleJourneyRefOrNormalDatedVehicleJourneyRef()
.stream()
.map(JAXBElement::getValue)
.filter(DatedServiceJourneyRefStructure.class::isInstance)
.map(DatedServiceJourneyRefStructure.class::cast)
.map(VersionOfObjectRefStructure::getRef)
.map(VehicleJourneyRefStructure::getRef)
.findFirst()
.orElse(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public ValidationTreeBuilder builder() {
)
.withRuleForLineFile(
new ValidateNotExist(
"vehicleJourneys/DatedServiceJourney/DatedServiceJourneyRef[@ref = preceding-sibling::DatedServiceJourneyRef/@ref]",
"vehicleJourneys/DatedServiceJourney/replacedJourneys/DatedVehicleJourneyRef[@ref = preceding-sibling::DatedVehicleJourneyRef/@ref]",
CODE_DATED_SERVICE_JOURNEY_5,
"DatedServiceJourney multiple references to the same DatedServiceJourney",
"Multiple references from a DatedServiceJourney to the same DatedServiceJourney",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public static NeTExValidator.NetexVersion detectNetexSchemaVersion(
return NeTExValidator.NetexVersion.v1_14;
case "1.15":
return NeTExValidator.NetexVersion.v1_15;
case "1.16":
return NeTExValidator.NetexVersion.v1_16;
default:
}
}
Expand Down
Loading