GraphQL: derive labels for triples? {changes}

10 views
Skip to first unread message

Dan Segal

unread,
Jul 7, 2021, 10:53:35 PMJul 7
to TopBraid Suite Users
Hello,

I am trying to export a change history for a graph using GraphQL and the Teamwork Graph schema.

Using a query such as the following:

{
  changes {
    added {
      subject
      predicate
      object
    }
  }
}


..the results appear as follows:

          {
            "subject": "http://www.example.org...",
            "predicate": "http://www.w3.org/2004/02/skos/core#broader",
            "object": "http://www.example.org..."
          }



Is there a way to embed a query (e.g., SPARQL) to derive human-readable labels for the subject, predicate, and object?

The goal is to display the labels (e.g., skos:prefLabel or sh:name) rather than the URIs, so that the output would look something like:

          {
            "subject": "Concept1",
            "predicate": "broader concept",
            "object": "Concept2"
          }

I have tried the label qualifier, such as:

{
  changes {
    added {
      subject:label
      predicate:label
      object:label
    }
  }
}


...but this returns system labels, rather than human-readable labels; for example:

   "added": [
          {
            "subject": "<@5bbe53c8-e3f1-4007-b2d8-ec288ea3e0cd>",
            "predicate": "<@5bbe53c8-e3f1-4007-b2d8-ec288ea3e0cd>",
            "object": "<@5bbe53c8-e3f1-4007-b2d8-ec288ea3e0cd>"
          }

Alternatively, is there a different way to export the change history?

Thanks!


Reply all
Reply to author
Forward
0 new messages