cncf / landscape-graph

CNCF Landscape Graph, data model, and applications.
https://github.com/orgs/cncf/projects/7/views/6
Other
37 stars 11 forks source link

Add Natural language support for queries #90

Open halcyondude opened 1 year ago

halcyondude commented 1 year ago

outcome: modular graph composition includes Natural Language support w/ low effort.

This will involve creating an Ontology, that maps phrases/nouns/verbs to Entities (nodes) and Relationships.

Because our data model is already in Neo4j, we can simply create an Ontology and load it into Neo4j using the Neosemantics plugin

In this QuickGraph, we have shown how to leverage existing Ontologies in Neo4j, using them to run powerful inferences that can enhance semantic search engines and smart recommendations.

We have shown how to encode knowledge in an Ontology, combine it with other knowledge fragments, and shown queries that have this explicit knowledge used by the inferencing procedures in Neosemantics to easily add powerful semantic capabilities to search and recommendation tasks.

When your data is connected to, or described in terms of an Ontology, you can modify the behaviour of your queries without having to annotate/update every data point in your graph. All you need to do is add explicit semantic definitions of your data.

For example, in the diagram below (from the blog), each Sub-Graph Module type would map to a Custom Ontology layer, with a "Domain Ontology" per concrete sgm definition.

image

Recent video on how to do this:

How neosemantics (n10s) moves a property graph <-> RDF to leverage semantic libraries.

{drumroll} --> It doesn't! "RDF*" is how this is accomplished.**

details: https://jbarrasa.com/2021/01/19/quickgraph14-using-rdf-with-neo4j

<excerpt>

*Level of support of RDF in n10s**

In the draft Community Group Report of 15 January 2021, RDF* triples are defined as triples that include a triple as a subject or an object. This translates into a number of new modelling possibilities one of which is the possibility to offer a simple way to represent properties of relationships.

This is precisely the use supported by n10s: In formal terms, n10s supports RDF* triples that have a triple as subject and a literal as object. The inner triple represents a relationship and the outer triple represents a property of that individual relationship. Here’s an example of these kind of triples:

<<:actor17 n4sch:ACTED_IN :movie32>> n4sch:role "Albert Goldman" .

Which effectively represents the following scenario

image

**Export: Serialising a Neo4j database as RDF***

RDF makes it possible to serialise/export a Property graph as RDF without data loss. Now, properties of relationships can be represented as RDF triples as described in the previous section. Let’s look at an example using the movie database that you can load into neo4j by running :play movies .

</excerpt>