diff --git a/.gitignore b/.gitignore index c21f0b5..e3f031f 100644 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,5 @@ project/plugins/project/ .cache .lib/ # Ignore Gradle build output directory -build \ No newline at end of file +build +.bsp \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 58a76c2..211ff2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:18.04 ARG USER_HOME_DIR="/root" ENV SCALA_VERSION 2.12.11 -ENV SBT_VERSION 1.3.9 +ENV SBT_VERSION 1.6.1 # Update the repository sources list and install dependencies RUN apt-get update @@ -43,7 +43,7 @@ RUN \ curl -L -o sbt-$SBT_VERSION.deb https://scala.jfrog.io/artifactory/debian/sbt-$SBT_VERSION.deb && \ dpkg -i sbt-$SBT_VERSION.deb && \ rm sbt-$SBT_VERSION.deb && \ - sbt sbtVersion + sbt -Dsbt.rootdir=true sbtVersion VOLUME "$USER_HOME_DIR/.sbt" diff --git a/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala b/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala index 8ffbbd4..8ce4ba9 100644 --- a/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala +++ b/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala @@ -22,7 +22,7 @@ class VocabularyPropertiesTest extends AsyncFunSuite with VocabularyTest { } test("Vocabularies parsing aml_meta") { - testVocabulary(aml_meta, 19, 31) + testVocabulary(aml_meta, 25, 38) } test("Vocabularies parsing api_contract") { diff --git a/project/build.properties b/project/build.properties index 1e70b0c..3161d21 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.0 +sbt.version=1.6.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index 8fbed3f..f86b50d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,3 @@ -addSbtPlugin("com.eed3si9n" % "sbt-sriracha" % "0.1.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("com.github.mwz" % "sbt-sonar" % "2.1.0") \ No newline at end of file +addSbtPlugin("com.eed3si9n" % "sbt-sriracha" % "0.1.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") +addSbtPlugin("com.sonar-scala" % "sbt-sonar" % "2.3.0") diff --git a/transform/dependencies.properties b/transform/dependencies.properties index f2307bf..8ea8628 100644 --- a/transform/dependencies.properties +++ b/transform/dependencies.properties @@ -1,4 +1,4 @@ # Leave here for the publication process to detect if amf-transform has to be published! # Because we publish a version of amf-transform for each version of amf-client publish. -amf.apicontract=5.0.4 -amf.rdf=6.0.4 +amf.apicontract=5.0.5 +amf.rdf=6.0.5 \ No newline at end of file diff --git a/versions.yaml b/versions.yaml index c53c070..3bf4eed 100644 --- a/versions.yaml +++ b/versions.yaml @@ -1,2 +1,2 @@ -amf.vocabulary: 20.0.0 -amf.transform: 2.4.0 +amf.vocabulary: 21.0.0 +amf.transform: 2.5.0 \ No newline at end of file diff --git a/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml b/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml index d2a8ee8..62df31f 100644 --- a/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml +++ b/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml @@ -32,7 +32,7 @@ nodeMappings: Scalar: ScalarShape Any: AnyShape Recursive: RecursiveShape - + union: - UnionShape - TupleShape @@ -45,7 +45,7 @@ nodeMappings: - ScalarShape - AnyShape - RecursiveShape - + SecuritySettingsUnion: typeDiscriminatorName: settingsType typeDiscriminator: @@ -55,7 +55,7 @@ nodeMappings: Http: HttpSettings OpenID: OpenIDSettings HttpAPIKey: HttpAPIKeySettings - + union: - OAuth2Settings - OAuth1Settings @@ -63,7 +63,7 @@ nodeMappings: - HttpSettings - OpenIDSettings - HttpAPIKeySettings - + DataNodeUnion: typeDiscriminatorName: elementType @@ -812,7 +812,7 @@ nodeMappings: - ParametrizedResourceType - ParametrizedTrait allowMultiple: true - + path: propertyTerm: apiContract.path range: string @@ -1116,7 +1116,7 @@ nodeMappings: propertyTerm: doc.extends range: Message allowMultiple: true - + name: propertyTerm: core.name range: string @@ -1443,7 +1443,7 @@ nodeMappings: - Operation - ParametrizedTrait allowMultiple: true - + method: propertyTerm: apiContract.method range: string @@ -2292,6 +2292,72 @@ nodeMappings: allowMultiple: true + baseIRIModel: + classTerm: meta.ContextBaseIri + mapping: + iri: + propertyTerm: meta.iri + range: link + nulled: + propertyTerm: meta.nulled + range: boolean + + + contextMappingModel: + classTerm: meta.ContextMapping + mapping: + contextAlias: + propertyTerm: meta.contextAlias + range: string + iri: + propertyTerm: meta.iri + range: link + coercion: + propertyTerm: meta.coercion + range: string + nulled: + propertyTerm: meta.nulled + range: boolean + + + curiePrefixModel: + classTerm: meta.ContextCuriePrefix + mapping: + contextAlias: + propertyTerm: meta.contextAlias + range: string + iri: + propertyTerm: meta.iri + range: link + + + defaultVocabularyModel: + classTerm: meta.ContextDefaultVocabulary + mapping: + iri: + propertyTerm: meta.iri + range: link + + + semanticContextModel: + classTerm: meta.SemanticContext + mapping: + base: + propertyTerm: meta.base + range: baseIRIModel + vocab: + propertyTerm: meta.vocab + range: defaultVocabularyModel + curies: + propertyTerm: meta.curies + range: curiePrefixModel + allowMultiple: true + mappings: + propertyTerm: meta.mappings + range: contextMappingModel + allowMultiple: true + + documents: diff --git a/vocabulary/src/main/resources/vocabularies/aml_meta.yaml b/vocabulary/src/main/resources/vocabularies/aml_meta.yaml index e9fc07e..4085245 100644 --- a/vocabulary/src/main/resources/vocabularies/aml_meta.yaml +++ b/vocabulary/src/main/resources/vocabularies/aml_meta.yaml @@ -3,10 +3,25 @@ vocabulary: meta base: http://a.ml/vocabularies/meta# usage: Vocabulary containing meta-definitions uses: - doc: aml_doc.yaml shacl: external/shacl.yaml + doc: aml_doc.yaml owl: external/owl.yaml classTerms: + ConditionalNodeMapping: + displayName: ConditionalNodeMapping + extends: shacl.Shape + ContextBaseIri: + displayName: baseIRIModel + description: Encodes information about the base document IRI for the model element @ids + ContextCuriePrefix: + displayName: curiePrefixModel + description: Stores information about a CURIE prefix defined in the context + ContextDefaultVocabulary: + displayName: defaultVocabularyModel + description: Encodes information about the base vocabulary to map by default properties and types in the model + ContextMapping: + displayName: contextMappingModel + description: Stores information about mapping rules for a property in the model Dialect: displayName: Dialect description: Definition of an AML dialect, mapping AST nodes from dialect documents into an output semantic graph @@ -77,6 +92,9 @@ classTerms: PublicNodeMapping: displayName: PublicNodeMapping description: Mapping for a graph node mapping to a particular function in a dialect + SemanticContext: + displayName: semanticContextModel + description: Set of semantic contextual information that can be attached to a schema UnionNodeMapping: displayName: UnionNodeMapping extends: shacl.Shape @@ -96,8 +114,20 @@ propertyTerms: range: boolean base: displayName: base - description: Base URI for the external model + description: Base IRI used to generate all the @ids in the model + range: ContextBaseIri + coercion: + displayName: coercion + description: Type to coerce the mapped model range: string + contextAlias: + displayName: contextAlias + description: lexical value of the alias in the context + range: string + curies: + displayName: curies + description: Set of CURIE prefixes defined in a context + range: ContextCuriePrefix declarationsPath: displayName: declarationsPath description: Information about the AST location of the declarations to be parsed as declared domain elements @@ -143,6 +173,10 @@ propertyTerms: displayName: fragments description: Mapping of fragment base unit for a particular dialect range: DocumentMapping + iri: + displayName: iri + description: Base IRI for all the elements in the model + range: uri keyProperty: displayName: keyProperty description: Information about whether the dialect is defined by the header or a key property @@ -171,10 +205,18 @@ propertyTerms: displayName: mappedNode description: Node in the dialect definition associated to this mapping range: uri + mappings: + displayName: mappings + description: Set of property mappings and coercions defined in a context + range: ContextMapping mergePolicy: displayName: mergePolicy description: Indication of how to merge this graph node when applying a patch document range: string + nulled: + displayName: nulled + description: Marks the baseIRI as null, preventing generation of absolute IRIs in the model + range: boolean properties: displayName: properties description: Properties that have the ClassTerm in the domain @@ -210,3 +252,7 @@ propertyTerms: displayName: unique description: Marks the values for the property mapping as a primary key for this type of node range: boolean + vocab: + displayName: vocab + description: Default IRI prefix used to map by default all properties and terms in the model + range: ContextDefaultVocabulary