dotwebstack / dotwebstack-framework

Framework for publishing rich data services.
https://dotwebstack.org/dotwebstack-framework/
MIT License
14 stars 8 forks source link

GraphQL filters with RDF4J module #878

Open hugovanversendaal opened 1 year ago

hugovanversendaal commented 1 year ago

Hi,

I'm trying to use GraphQL filters with the RDF4J backend module, but I'm not getting the expected result.

I'm using the following setup:

query {
    beers(filter: { name: {eq: "Beer 1"} }) {
        identifier
        name
    }
}

The expected result is:

{
  "data": {
    "beers": [
      {
        "identifier": "b0e7cf18-e3ce-439b-a63e-034c8452f59c",
        "name": "Beer 1"
      }
    ]
  }
}

The actual result is:

{
  "data": {
    "beers": [
      {
        "identifier": "b0e7cf18-e3ce-439b-a63e-034c8452f59c",
        "name": "Beer 1"
      },
      {
        "identifier": "1295f4c1-846b-440c-b302-80bbc1f9f3a9",
        "name": "Beer 2"
      },
      {
        "identifier": "973832e7-1dd9-4683-a039-22390b1c1995",
        "name": "Beer 3"
      },
      {
        "identifier": "a5148422-be13-452a-b9fa-e72c155df3b2",
        "name": "Beer 4"
      },
      {
        "identifier": "766883b5-3482-41cf-a66d-a81e79a4f0ed",
        "name": "Beer 5"
      }
    ]
  }
}

Below is the SPARQL-query in the logging:

2023-08-22 09:43:12 2023-08-22T07:43:12.332Z DEBUG 1 --- [or-http-epoll-3] o.d.framework.backend.rdf4j.query.Query  : Executing query: SELECT * 
2023-08-22 09:43:12 WHERE { VALUES ?x2 {<https://github.com/dotwebstack/beer/def#Beverage> <https://github.com/dotwebstack/beer/def#Beer>}
2023-08-22 09:43:12 ?x1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2000/01/rdf-schema#subClassOf>* ?x2 .
2023-08-22 09:43:12 ?x1 <https://github.com/dotwebstack/beer/def#identifier> ?x3 .
2023-08-22 09:43:12 ?x1 <http://schema.org/name> ?x4 . }
pmaria commented 1 year ago

Hi @hugovanversendaal , I'm afraid that the RDF4J backend module is not yet feature complete and as such does not yet support filters amongst some other features. This is not made very clear at the moment.

I'm afraid there is currently no perspective on any development on the RDF4J backend in the near future from our side since our primary usage is of the Postgres backend.

Could you perhaps share a bit on how are you aiming to use the RDF4J backend? What kind of functionality would you need?

hugovanversendaal commented 1 year ago

Hi @pmaria,

Thanks for the explanation. My team uses RDF4J to distribute linked data via a SPARQL endpoint. However, some of our customers prefer a more user friendly interface to retrieve the data and require simple JSON results. That's why DotWebStack is very convenient for us.

Two features would be very useful:

pmaria commented 1 year ago

Hi @hugovanversendaal

Thanks for your response.

Would your team be open and able to contribute? If so, we could plan a meeting to discuss.

hugovanversendaal commented 1 year ago

Hi @pmaria,

I will forward the question to the rest of my team and will let you know what the outcome is. After today, I will be out of office for three weeks, so this may take while.