Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace prefix should be definable by a user #215

Open
sjiherzig opened this issue Jan 18, 2018 · 1 comment
Open

Namespace prefix should be definable by a user #215

sjiherzig opened this issue Jan 18, 2018 · 1 comment

Comments

@sjiherzig
Copy link
Member

Currently, the namespace prefix is implicitly assumed to be the last part of an IRI. For instance, consider the following example:

open terminology <http://jpl.nasa.gov/someTerminology> {
    extends <http://jpl.nasa.gov/anotherTerminology>

    concept Foo

    Foo extendsConcept anotherTerminology:Bar
}

where the ontology being extended from is assumed to be defined as:

open terminology <http://jpl.nasa.gov/anotherTerminology> {
    concept Bar
}

Problematic are cases where the IRI ends with the same suffix. In such cases, the prefix may no longer be unique. For instance, consider the following example:

closed terminology <http://jpl.nasa.gov/someModel> {
    extends <http://jpl.nasa.gov/someTool/metamodel>
    extends <http://jpl.nasa.gov/someOtherTool/metamodel>

    ...
}

In such cases, it is impossible to differentiate between the two ontologies being extended from.

Suggestion: add an optional specification of a namespace prefix that, if left unset, defaults back to the current strategy.

E.g., for terminology extension axioms:

TerminologyExtensionAxiom returns TerminologyExtensionAxiom:
	( annotations+=AnnotationPropertyValue )*
	'extends' (nsPrefix=STRING ':')? extendedTerminology=[TerminologyBox|ExternalReference];

This would result in syntax such as:

closed terminology <http://jpl.nasa.gov/someModel> {
    extends someToolMM : <http://jpl.nasa.gov/someTool/metamodel>
    extends someOtherToolMM : <http://jpl.nasa.gov/someOtherTool/metamodel>

    ...

    Foo extendsConcept someToolMM:MetaBar

    Bar extendsConcept someOtherToolMM:MetaFoo

    ...
}

(Note that this is just a suggestion for how to do it - whether this is the best possible syntax is up for debate)

@NicolasRouquette
Copy link
Member

I think this is doable by adding in OML ModuleEdge an optional nsPrefix string property.

For the concrete syntax, I think '=' would make more sense than ':';, i.e.,:

closed terminology <http://jpl.nasa.gov/someModel> {
    extends someToolMM = <http://jpl.nasa.gov/someTool/metamodel>
    extends someOtherToolMM = <http://jpl.nasa.gov/someOtherTool/metamodel>

    ...

    Foo extendsConcept someToolMM:MetaBar

    Bar extendsConcept someOtherToolMM:MetaFoo

    ...
}

This is not a big deal to do; however, this will require updating all the other OML infrastructure components in Scala as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants