koopjs / koop-provider-marklogic

A Koop Provider that can be used to exposed data in MarkLogic via Esri feature services
https://koopjs.github.io/koop-provider-marklogic/
Other
6 stars 11 forks source link

Allow an additional SPARQL query that is joined to the view #82

Closed jkerr5 closed 5 years ago

jkerr5 commented 6 years ago

As a first step to supporting using SPARQL to supply feature properties, we can add a SPARQL query that is joined with the rows from the view. This would require the results from the SPARQL query to contain a column that can be joined against the view.

Specifying the SPARQL for a layer might look something like this:

joins : [
  {
      "source" : "sparql",
      "query" : "SELECT * ...",
      "joinOn" : {
        "left" : "viewField1",
        "right" : "myfield1"
      },
      "fields" : {
        "myfield1" : { "type" : "string" },
        "myfield2" : { "type" : "boolean" }
      }    
  }
]

The fields object is needed to specify what fields will come back from the SPARQL query.

The joinOn object specifies the left and right columns that should be used to perform the join. left specifies the field from the view and right specifies the field from the SPARQL results.