type that the mapper accepts, here: any class of B
+ * @param the parser type, here: to parse data of A
+ * @param the type of mapping context
+ */
+public interface TargetBasedMapper extends Mapper {
+
+ /**
+ * Reads from the parser and returns the mapping result.
+ *
+ * @param parser the parser to read the actual input
+ * @param context the context
+ * @return a new instance of T created by mapping data given by the parser
+ * @throws MappingException
+ */
+ public T map(P parser, C context) throws MappingException;
+}
diff --git a/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java
new file mode 100644
index 00000000..d87531bf
--- /dev/null
+++ b/dataformat-core/src/main/java/io/adminshell/aas/v3/dataformat/mapping/TargetBasedMappingContext.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.adminshell.aas.v3.dataformat.mapping;
+
+public abstract class TargetBasedMappingContext extends MappingContext {
+
+ public TargetBasedMappingContext(MappingProvider mappingProvider) {
+ super(mappingProvider);
+ }
+
+}
diff --git a/dataformat-rdf/license-header.txt b/dataformat-rdf/license-header.txt
new file mode 100644
index 00000000..b531b74a
--- /dev/null
+++ b/dataformat-rdf/license-header.txt
@@ -0,0 +1,13 @@
+Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java
index 1320f7f1..711cda56 100644
--- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java
+++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java
@@ -26,6 +26,7 @@
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
+import io.adminshell.aas.v3.dataformat.core.DataSpecificationInfo;
import static io.adminshell.aas.v3.dataformat.core.DataSpecificationManager.PROP_DATA_SPECIFICATION;
import static io.adminshell.aas.v3.dataformat.core.DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT;
@@ -52,7 +53,8 @@ public void serialize(EmbeddedDataSpecification data, JsonGenerator generator, S
Reference reference = null;
DataSpecificationContent content = data.getDataSpecificationContent();
if (content != null) {
- Reference implicitType = DataSpecificationManager.getReferenceSafe(content.getClass());
+ DataSpecificationInfo implicitDataSpecification = DataSpecificationManager.getDataSpecification(content.getClass());
+ Reference implicitType = implicitDataSpecification != null ? implicitDataSpecification.getReference() : null;
Reference explicitType = data.getDataSpecification();
if (implicitType == null) {
logger.warn("Trying to serialize unknown implementation of DataSpecificationContent ({}). "
diff --git a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/KeySerializer.java
index b3fe9d9d..3ca87ac0 100644
--- a/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/KeySerializer.java
+++ b/dataformat-xml/src/main/java/io/adminshell/aas/v3/dataformat/xml/serialization/KeySerializer.java
@@ -1,52 +1,52 @@
-/*
- * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.adminshell.aas.v3.dataformat.xml.serialization;
-
-import java.io.IOException;
-
-import javax.xml.stream.XMLStreamException;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
-
-import io.adminshell.aas.v3.dataformat.core.serialization.EnumSerializer;
-import io.adminshell.aas.v3.model.Key;
-
-public class KeySerializer extends JsonSerializer {
-
- @Override
- public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers) throws IOException {
- ToXmlGenerator xgen = (ToXmlGenerator) gen;
- xgen.writeObjectFieldStart("key");
-
- try {
- String idTypeValue = EnumSerializer.translate(key.getIdType().toString());
- xgen.getStaxWriter().writeAttribute("idType", idTypeValue);
- String keyTypeValue = EnumSerializer.translate(key.getType().toString());
- xgen.getStaxWriter().writeAttribute("type", keyTypeValue);
- } catch (XMLStreamException e) {
- e.printStackTrace();
- }
- xgen.setNextIsAttribute(false);
- xgen.setNextIsUnwrapped(true);
- xgen.writeFieldName("value");
- xgen.writeString(key.getValue());
-
- xgen.writeEndObject();
- }
-}
+/*
+ * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.adminshell.aas.v3.dataformat.xml.serialization;
+
+import java.io.IOException;
+
+import javax.xml.stream.XMLStreamException;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
+import io.adminshell.aas.v3.dataformat.core.util.AasUtils;
+
+import io.adminshell.aas.v3.model.Key;
+
+public class KeySerializer extends JsonSerializer {
+
+ @Override
+ public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+ ToXmlGenerator xgen = (ToXmlGenerator) gen;
+ xgen.writeObjectFieldStart("key");
+
+ try {
+ String idTypeValue = AasUtils.serializeEnumName(key.getIdType().toString());
+ xgen.getStaxWriter().writeAttribute("idType", idTypeValue);
+ String keyTypeValue = AasUtils.serializeEnumName(key.getType().toString());
+ xgen.getStaxWriter().writeAttribute("type", keyTypeValue);
+ } catch (XMLStreamException e) {
+ e.printStackTrace();
+ }
+ xgen.setNextIsAttribute(false);
+ xgen.setNextIsUnwrapped(true);
+ xgen.writeFieldName("value");
+ xgen.writeString(key.getValue());
+
+ xgen.writeEndObject();
+ }
+}
diff --git a/pom.xml b/pom.xml
index aefc8fef..394a18d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,7 @@
pom
dataformat-aasx
+ dataformat-aml
dataformat-core
dataformat-json
dataformat-xml
@@ -45,6 +46,7 @@
11
UTF-8
UTF-8
+ 3.3.1
1.2.2
3.2.0
4.1
@@ -53,11 +55,14 @@
2.6
2.12.3
2.0.1.Final
+ 2.3.1
+ 2.1.0
4.1.0
1.5.0
1.0.56
4.13
1.1.1
+ 2.7.8
4.1.2
1.7.31
2.8.2
diff --git a/validator/license-header.txt b/validator/license-header.txt
new file mode 100644
index 00000000..b531b74a
--- /dev/null
+++ b/validator/license-header.txt
@@ -0,0 +1,13 @@
+Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file