Uploaded image for project: 'Artificer'
  1. Artificer
  2. ARTIF-627

Re-work the S-RAMP->JCR query visitor using ModeShape JCR-JQOM

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.Alpha1
    • Component/s: None
    • Labels:
      None

      Description

      SrampToJcrSql2QueryVisitor is extremely brittle and inflexible. See SRAMP-622 for an example. The following query is next to impossible:

      /s-ramp/xsd/XsdDocument[relWithAttr[s-ramp:getRelationshipAttribute(., 'FooKey') = 'FooValue' and @FooProperty = 'FooValue']]

      Note that the getRelationshipAttribute predicate function affects the relWithAttr relationship itself, while the @FooProperty check must go in the target artifact sub-query. Correctly handling this query will require a Builder pattern to be introduced.

      Attempt to use ModeShape's JCR-JQOM:
      https://docs.jboss.org/author/display/MODE40/JCR-JQOM

      ModeShape also has a builder class, but it's not public and may pose additional issues.

      (10:00:16 AM) rhauch: brmeyer: well, it's not public: https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java and https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/test/java/org/modeshape/jcr/query/QueryBuilderTest.java#L71
      (10:01:39 AM) rhauch: brmeyer: that builder is somewhat limited, and it is really meant for hard-coded code. For example, there are places where you'd have to build strings (e.g., using "AS" for aliases)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  brmeyer Brett Meyer
                  Reporter:
                  brmeyer Brett Meyer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: