Skip to content

GraphQueryBuilderService method buildQueryFromMetaModel #105

@BenjaminHofstetter

Description

@BenjaminHofstetter

The GraphQueryBuilderService generates SPARQL queries to expand nodes, retrieve connecting links, and retrieve node data based on the blueprint link configuration.

The flow worked similar like this.

flowchart LR
        A(["Blueprint Link Definition (Configuration)"])
        A --> B["Transform Data into a Node and Edge Model"]
        B --> C["Display Node and Edge Model in the UI Graph View"]
Loading

To support RDF Graph browsing, the fastest way was to get all predicates referencing IRI objects and generate a “synthetic” link configuration from them.

flowchart LR
        A(["Blueprint Link Definition (Configuration)"])
        R(["RDF Predicates to Blueprint Link Definition (Synthetic Configuration)"])
        A -->  L(["Blueprint and RDF Link Definitions"])
        R --> L
        L --> B["Transform Data into a Node and Edge Model"]
        B --> C["Display Node and Edge Model in the UI Graph View"]
 style A fill:yellow,stroke:#333,stroke-width:4px
 style R fill:lightgreen,stroke:#333,stroke-width:4px
Loading

We can generalize the approach a bit more.

flowchart LR
        A(["What are we going to transform to a graph"])
        A --> S["SPARQL CONSTRUCT"]
        S --> B["Graph model (edges and nodes)"]
Loading

This solution has a few issues.

  1. Which configuration should be used "app", "rdf", or "both"
    A link configuration of "app" means we only use Blueprint Link definitions. "rdf" means we only use the predicates and its tbox to generate a link. But what means "both"?
    Currently, we don’t show both. We remove duplicate links by removing RDF predicates that match the first path element of the blueprint link. This is challenging because we have incoming and outgoing links, and incoming links with a last predicate like ^ex:something, which creates double inverted paths and its a constant source of errors.

  2. Graph Structure is not good enough
    The “Graph” and “Relations” views consume the graph structure. Both views no longer use the original structure. The “Graph” view consolidates links between the same Concepts and knows bidirectional links. The “Relations” view shows the neighbors of the current node. The idea was to group relations by domain/range, but transforming the graph model to this structure is challenging.

  3. Is Blueprint link configuration vs. Predicate TBOX
    Is Blueprint link configuration the same as Predicate TBOX? Currently, to support RAW RDF, we create a “synthetic” Link configuration for a predicate from the Predicate TBOX. We attach TBOX information to the graph and UI to provide “source” information and improve arrow and label labels. Isn’t the link configuration the same as an Ontology or better, the predicates TBOX?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions