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

Make all module imports relative #368

Open
bwbohl opened this issue Feb 21, 2024 · 2 comments
Open

Make all module imports relative #368

bwbohl opened this issue Feb 21, 2024 · 2 comments
Assignees
Labels
Area: XQuery Type: cleanup Type: good first issue A small fix that could be tackled by newcomers ;-)
Milestone

Comments

@bwbohl
Copy link
Member

bwbohl commented Feb 21, 2024

As pointed out in #349 we sometimes have absolute db paths, which of course could be problematic, as it depends on the install location.

good first issue

This is a good first issue if you want to get involved in the development of Edirom Online, because:

  • it has to be executed on a defined set of files, namely all those in the directories:

    • add/data/xqm, and
    • add/data/xql
  • there is a defined way of finding the portions to check (at the very beginning of each file), e.g.:

    (: IMPORTS ================================================================= :)
    
    import module namespace kwic = "http://exist-db.org/xquery/kwic";
    import module namespace transform="http://exist-db.org/xquery/transform";
    
    import module namespace eutil = "http://www.edirom.de/xquery/util" at "xmldb:exist://db/apps/Edirom-Online/data/xqm/util.xqm";
    
  • You do not need experience with XQuery files

  • You can use it to familiarise with both, the Edirom Online codebase, and the XQuery programming language

  • Here is an example fix for the above codeblock:

    1. spot the import module namespace declarations
    • each of them begins on a new line and ends with ;
    • everything before the =can stay as it is
    • if the portion between " and "; is a absolute URI starting with httpor https it can stay as it is
    • if it starts with something else, e.g. xmldb:exist:// and has Edirom-Online in it, change it to a relative link for the file you're currently editing to the file it’s referencing.
    • so for the above (which is taken from Edirom-Online/add/data/xql/search.xql the correct relative URL would be:
    ../xqm/util.xqm
    • the complete corrected lin:
        import module namespace eutil = "http://www.edirom.de/xquery/util" at "../xqm/util.xqm";

If you have any questions concerning the ticket feel free to contact @bwbohl

@bwbohl bwbohl added this to the refactoring milestone Feb 21, 2024
@krHERO krHERO removed this from the refactoring milestone Jul 4, 2024
@bwbohl bwbohl added this to the 1.0.0 milestone Sep 6, 2024
@bwbohl bwbohl added the Type: good first issue A small fix that could be tackled by newcomers ;-) label Sep 6, 2024
@bwbohl
Copy link
Member Author

bwbohl commented Oct 11, 2024

@hizclick any chance you find time to get into this until November?

@hizclick
Copy link
Contributor

@bwbohl, I couldn't locate an import module with a namespace starting with xmldb:exist:// and an absolute path. However, I did find incorrect paths in the annotation, etext, util, and work sqm files in commit d4737b8.

bwbohl pushed a commit that referenced this issue Oct 23, 2024
* Make-all-module-imports-relative Resolving issue #368

* Make-all-module-imports-relative Resolving issue #368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: XQuery Type: cleanup Type: good first issue A small fix that could be tackled by newcomers ;-)
Projects
Status: Backlog
Development

No branches or pull requests

4 participants