Clerezza
  1. Clerezza
  2. CLEREZZA-761

Implement SPARQL PreParser to support fastlane

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The purpose is to have a class with a method to obtain referred graphs in a SPARQL Query or SPARQL Update

        Activity

        Hasan created issue -
        Hide
        Hasan added a comment -

        SPARQL Update is not yet supported

        Also not yet supported within BuiltInCall in Query:
        [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern
        [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern

        Show
        Hasan added a comment - SPARQL Update is not yet supported Also not yet supported within BuiltInCall in Query: [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern
        Hide
        Reto Gmür added a comment -

        zz>import org.apache.clerezza.rdf.core.sparql._
        import org.apache.clerezza.rdf.core.sparql._
        zz>val spp = $[SparqlPreParser]
        spp: org.apache.clerezza.rdf.core.sparql.SparqlPreParser = org.apache.clerezza.rdf.core.sparql.SparqlPreParser@3aa78e7a
        zz>spp.getReferredGraphs("SELECT DISTINCT ?g { GRAPH ?g

        { ?s ?p ?o }

        }", new UriRef("urn:x-localinstance:/content.graph"))
        res0: java.util.Set[org.apache.clerezza.rdf.core.UriRef] = [<urn:x-localinstance:/content.graph>]
        zz>

        As discussed in http://mail-archives.apache.org/mod_mbox/clerezza-dev/201303.mbox/%3C51498242.4020809@apache.org%3E this should return all the graphs in the dataset. I think that SParqlPreParser being a service it could consider by default TcManager being the dataset, but it probably should also have a method that takes any TcProvider as dataset and return it's triple collections.

        Show
        Reto Gmür added a comment - zz>import org.apache.clerezza.rdf.core.sparql._ import org.apache.clerezza.rdf.core.sparql._ zz>val spp = $ [SparqlPreParser] spp: org.apache.clerezza.rdf.core.sparql.SparqlPreParser = org.apache.clerezza.rdf.core.sparql.SparqlPreParser@3aa78e7a zz>spp.getReferredGraphs("SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } }", new UriRef("urn:x-localinstance:/content.graph")) res0: java.util.Set [org.apache.clerezza.rdf.core.UriRef] = [<urn:x-localinstance:/content.graph>] zz> As discussed in http://mail-archives.apache.org/mod_mbox/clerezza-dev/201303.mbox/%3C51498242.4020809@apache.org%3E this should return all the graphs in the dataset. I think that SParqlPreParser being a service it could consider by default TcManager being the dataset, but it probably should also have a method that takes any TcProvider as dataset and return it's triple collections.
        Hide
        Hasan added a comment -

        As discussed in email [1], the SPARQL PreParser now returns null rather than all graphs if no named graphs are specified in the query

        [1] http://mail-archives.apache.org/mod_mbox/clerezza-dev/201304.mbox/%3CCALvhUEW2HjucR4Wv2RCfkoGS6uh8R_jt-JaFwSzs%2B%2BFaae_J7w%40mail.gmail.com%3E

        Show
        Hasan added a comment - As discussed in email [1] , the SPARQL PreParser now returns null rather than all graphs if no named graphs are specified in the query [1] http://mail-archives.apache.org/mod_mbox/clerezza-dev/201304.mbox/%3CCALvhUEW2HjucR4Wv2RCfkoGS6uh8R_jt-JaFwSzs%2B%2BFaae_J7w%40mail.gmail.com%3E
        Hide
        Reto Gmür added a comment -

        WHILE DROP-querie seems to be support INSERT queries cause an exception to be thrown.

        Show
        Reto Gmür added a comment - WHILE DROP-querie seems to be support INSERT queries cause an exception to be thrown.
        Hide
        Hasan added a comment -

        The preparser should only return null if no named graphs are specified in the query AND if there is a graph graph pattern referring a variable.
        In this case the preparser has to support parsing GroupGraphPattern. I am starting to implement support of preparsing GroupGraphPattern.

        Show
        Hasan added a comment - The preparser should only return null if no named graphs are specified in the query AND if there is a graph graph pattern referring a variable. In this case the preparser has to support parsing GroupGraphPattern. I am starting to implement support of preparsing GroupGraphPattern.
        Hide
        Hasan added a comment -

        Now the preparser returns null for "SELECT DISTINCT ?g { GRAPH ?g

        { ?s ?p ?o }

        }"

        Show
        Hasan added a comment - Now the preparser returns null for "SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } }"
        Hide
        Hasan added a comment -

        All SPARQL Update operations and new functions in SPARQL Query are now supported by the preparser. Note that the preparser is only able to obtain referred graphs, but cannot completely generate parsed objects, e.g., it ignores variables binding defined using the BIND keyword.

        Show
        Hasan added a comment - All SPARQL Update operations and new functions in SPARQL Query are now supported by the preparser. Note that the preparser is only able to obtain referred graphs, but cannot completely generate parsed objects, e.g., it ignores variables binding defined using the BIND keyword.
        Hasan made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hasan added a comment -

        I added some tests in SparqlPreParserTest.java and all passed. However, if you find errors, please add a test there and comment it out, reopen the issue, and I'll try to fix it.

        Show
        Hasan added a comment - I added some tests in SparqlPreParserTest.java and all passed. However, if you find errors, please add a test there and comment it out, reopen the issue, and I'll try to fix it.
        Hasan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Reto Gmür added a comment -

        simple describe fails, adding failing test (commented out)

        Show
        Reto Gmür added a comment - simple describe fails, adding failing test (commented out)
        Reto Gmür made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        Hasan added a comment -

        will look into it, probably this evening

        Show
        Hasan added a comment - will look into it, probably this evening
        Hasan made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hasan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        216d 2h 4m 1 Hasan 27/Oct/13 06:56
        Closed Closed Reopened Reopened
        83d 6h 52m 1 Reto Gmür 18/Jan/14 13:55
        Reopened Reopened Resolved Resolved
        6d 7h 12m 1 Hasan 24/Jan/14 21:08
        Resolved Resolved Closed Closed
        8m 4s 2 Hasan 24/Jan/14 21:09

          People

          • Assignee:
            Hasan
            Reporter:
            Hasan
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development