Closed LucasBassetti closed 4 years ago
@LucasBassetti the transformation is keeping the original labels even when we add new ones.
For instance, in the example:
{
name: 'alpinebitsCustomLabel.ttl',
model: alpinebits,
options: {
format: 'Turtle',
baseIRI: 'https://alpinebits.org',
createInverses: true,
customElementMapping: {
JoK2ZeaGAqACBxS5: { uri: 'OWLPerson', label: { pt: 'Pessoa' } },
Organization: { uri: 'OWLOrganization' },
'Event Plan': { uri: 'OWLEventPlan' },
'3x40WRaGAqCsIB4X': { uri: 'hasTrail', label: { en: 'hasLabel' } },
},
},
}
We get:
:OWLPerson rdf:type owl:Class, owl:NamedIndividual;
rdfs:label "Person".
:OWLPerson rdfs:subClassOf :Agent, gufo:FunctionalComplex;
rdf:type gufo:Kind;
rdfs:label "Pessoa"@pt.
I think this can be confusing to our final users, so I propose we do one of the following:
What do you think?
If we choose to discard the original labels, we could add the following code fragment to the transformAnnotations
function in the annotations_function.ts
file:
if (Object.keys(customLabel).length > 0) {
const elementType =
typeof element.type === 'string' ? element.type : 'Element';
let description;
if (element.name)
description = elementType + ' named "' + element.name + '" in the origin conceptual model.';
else
description = elementType + ' unnamed in the origin conceptual model.';
quads.push( quad(namedNode(uri), namedNode('rdfs:comment'), literal(description)) );
}
@tgoprince I updated to have a default label. Example
customElementMapping: {
hF1rKw6GAqACBCXn: {
uri: 'mediation',
label: { default: 'OWLMediation' },
}
}
Introduction
This PR adds the option to add custom labels. (#29)
How to use
You can use
id
orname
for create custom labels. Like so:Output