zazuko / xrm

A friendly language for mappings to RDF
MIT License
1 stars 0 forks source link

No code assist for templates outside the original file #88

Closed ktk closed 4 years ago

ktk commented 4 years ago

I'm moving the SBB dataset to the new syntax. From what I get the link keyword is no longer valid and has to be replaced by template.

Due to CSV I have to split the mapping into multiple files. When I define a template like this:

template tarifIri "http.//lod.opentransportdata.swiss/tarif/{0}"

code assist only seems to work in the file I define it itself. I cannot use code assist for tarifIri outside that file where I define it for neither subject template or using it as an object.

Am I missing something or is this a bug?

My idea is to define all templates in one separate file so it's easier to track what already exists and what not.

mchlrch commented 4 years ago

Yes, currently proposals in code assist only include templates from the same file. Scoping is not narrowed, so it is possible to also reference templates declared in other files, but you have to know the name of the template (no code-assist).

So far, the assumption was that templates are mostly re-used locally (inside the same file). If that is not the case, then we can change this to have all templates in proposals

nnamtug commented 4 years ago

integrate duplicated qName validation

Update your editor, perform a project clean.

I added a validation for duplicated QualifiedNames within the complete project. For now, this validation is only enabled for TemplateDeclarations. But it should be considered to perform this validation for all elements that are referenced without using any modifications in the ScopeProvider. Otherwise outgoing references are simply ambiguous if there are multiple targets with the same QName. Check the link above, how type specific validation can be enabled/tuned now.

This validation should be enabled for e.g.

mchlrch commented 4 years ago

I added a validation for duplicated QualifiedNames ... it should be considered to perform this validation for all elements that are referenced

Thanks, good remark. I agree with that suggestion. It has already happened to me that I had multiple Referenceables defined with the same ID in a single source.

I create a new issue for validating all elements that are referenced #97