FahrzeugID verbessert
This commit is contained in:
@@ -21,6 +21,7 @@ import org.springframework.web.client.RestClient;
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.io.Console;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.math.BigDecimal;
|
||||
@@ -68,11 +69,11 @@ public class RDFHelper {
|
||||
|
||||
for (Resource iri : Models.subjectIRIs(model)) {
|
||||
String bez = Models.objectLiteral(model.filter(iri, bezIri, null)).map(Literal::getLabel).orElse(null);
|
||||
String prodId = Models.objectResource(model.filter(iri, produktIri, null)).map(Resource::stringValue).orElse(null);
|
||||
String prodId = Models.objectResource(model.filter(iri, produktIri, null)).map(Resource::stringValue)
|
||||
.orElse(Models.objectLiteral(model.filter(iri, produktIri, null)).map(Literal::getLabel).orElse(null));
|
||||
Boolean required = Boolean.valueOf(Models.objectLiteral(model.filter(iri, requiredIri, null)).map(Literal::getLabel).orElse(null));
|
||||
Boolean aenderbar = Boolean.valueOf(Models.objectLiteral(model.filter(iri, aenderbarIri, null)).map(Literal::getLabel).orElse("true"));
|
||||
|
||||
|
||||
if (iri.stringValue().contains("ElemBoolean")) {
|
||||
AttributBooleanType ab = new AttributBooleanType();
|
||||
|
||||
@@ -330,6 +331,10 @@ public class RDFHelper {
|
||||
|
||||
Optional<String> parentId = Models.objectResource(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/Parent"), null)).map(Resource::stringValue);
|
||||
if (parentId.isEmpty()) {
|
||||
parentId = Models.objectLiteral(model.filter(iri, vf.createIRI(
|
||||
"http://vvo.pisanoapi.at/Parent"), null)).map(Literal::getLabel);
|
||||
}
|
||||
|
||||
ObjectFactoryFactory off = new ObjectFactoryFactory();
|
||||
|
||||
@@ -395,7 +400,6 @@ public class RDFHelper {
|
||||
List<Pair<String, FahrzeugType>> erg = new ArrayList<>();
|
||||
|
||||
String baseIri = "http://vvo.pisanoapi.at/";
|
||||
|
||||
IRI bezIri = iri(baseIri + "bez");
|
||||
IRI baujahrIri = iri(baseIri + "baujahr");
|
||||
IRI erstzulassungIri = iri(baseIri + "erstzulassung");
|
||||
@@ -433,8 +437,6 @@ public class RDFHelper {
|
||||
|
||||
addProduktToModel(vp, erg, baseIri, null, iriMap);
|
||||
|
||||
Rio.write(erg, System.out, RDFFormat.TURTLE);
|
||||
|
||||
return erg;
|
||||
}
|
||||
|
||||
@@ -580,7 +582,7 @@ public class RDFHelper {
|
||||
for (VersichertesInteresseType ro : produkt.getVersicherteObjekte()){
|
||||
if (ro instanceof FahrzeugType fa){
|
||||
IRI fahrzeugIri = iri(baseIri + "FahrzeugType");
|
||||
IRI faIri = iri(fahrzeugIri.stringValue() + fahrzeugId);
|
||||
IRI faIri = iri(fahrzeugIri.stringValue() + fa.getHandelsbez() + fa.getBaujahr());
|
||||
IRI faBaujahrIri = iri(baseIri + "baujahr");
|
||||
IRI faBezIri = iri(baseIri + "bez");
|
||||
IRI faErstZuIri = iri(baseIri + "erstzulassung");
|
||||
|
||||
Reference in New Issue
Block a user