Skip to content

Commit

Permalink
Fixed replacement for bamm:characteristic
Browse files Browse the repository at this point in the history
  • Loading branch information
ysrbo committed Sep 15, 2023
1 parent 506805e commit 45fc70d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ protected Literal updateLiteral( final Literal literal, final Map<String, String
protected RDFNode updateRdfNode( final RDFNode rdfNode, final Map<String, String> oldToNewNamespaces ) {
if ( rdfNode.isResource() ) {
return updateResource( rdfNode.asResource(), oldToNewNamespaces );
} else if ( rdfNode.isLiteral() ) {
// needed especially for "curie" literals, which are versioned: "unit:day"^^samm:curie
} else if ( rdfNode.isLiteral() ) { // needed especially for "curie" literals, which are versioned: "unit:day"^^samm:curie
return updateLiteral( rdfNode.asLiteral(), oldToNewNamespaces );
}
return rdfNode;
Expand Down Expand Up @@ -100,7 +99,8 @@ protected Map<String, String> buildReplacementPrefixMap( final Model sourceModel
* @param oldToNewNamespaces the map of old RDF namespaces to their new counterparts
* @return the prefix map
*/
protected Map<String, String> buildPrefixMap( final Model sourceModel, final Map<String, String> targetPrefixes, final Map<String, String> oldToNewNamespaces ) {
protected Map<String, String> buildPrefixMap( final Model sourceModel, final Map<String, String> targetPrefixes,
final Map<String, String> oldToNewNamespaces ) {
return sourceModel.getNsPrefixMap().keySet().stream()
.map( prefix -> Map.<String, String> entry( prefix, targetPrefixes.getOrDefault( prefix, sourceModel.getNsPrefixURI( prefix ) ) ) )
.collect( Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected Map<String, String> buildReplacementPrefixMap( final Model sourceModel
// The mapping of the URNs of the legacy BAMM Aspect Meta model to their corresponding SAMM counterparts
return Map.of(
"urn:bamm:io.openmanufacturing:meta-model:" + bammVersion.versionString() + "#", targetPrefixes.get( "samm" ),
"urn:bamm:io.openmanufacturing:characteristic: " + bammVersion.versionString() + "#", targetPrefixes.get( SAMM_C_PREFIX ),
"urn:bamm:io.openmanufacturing:characteristic:" + bammVersion.versionString() + "#", targetPrefixes.get( SAMM_C_PREFIX ),
"urn:bamm:io.openmanufacturing:entity:" + bammVersion.versionString() + "#", targetPrefixes.get( SAMM_E_PREFIX ),
"urn:bamm:io.openmanufacturing:unit:" + bammVersion.versionString() + "#", targetPrefixes.get( "unit" )
);
Expand Down

0 comments on commit 45fc70d

Please sign in to comment.