cncf / cncf/landscape-graph

Add Natural language support for queries

Open
#90 0 comments 0 reactions 0 assignees View on GitHub
brainstorm help wanted
Dominant language
Jupyter Notebook
Stars
55
Forks
19
PR merge metrics
No merged PRs in 30d

Description

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

- "How many companies have contributed to CloudEvents?"
- "How many Incubating or Graduated projects have 2 or fewer companies maintaining the project?"
- "If I want to use `$someCncfProject` what other projects or packages does it depend on?
- "Who are the current Tech Leads for TAG xyz?"

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](https://neo4j.com/labs/neosemantics)

* https://jbarrasa.com/2019/11/25/quickgraph9-the-fashion-knowledge-graph-inferencing-with-ontologies-in-neo4j

> 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](https://user-images.githubusercontent.com/3286990/182941724-be12d526-3143-4d16-8e3f-20063284a23f.png)

## Recent video on how to do this:

* video: [Going meta - Ep 7: Generating natural language from your knowledge graph by annotating ontologies](https://youtu.be/Y_IygO4MOqc)
* code (cypher + ontology inputs): https://github.com/jbarrasa/goingmeta/tree/main/session7

## 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

``

> **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](https://user-images.githubusercontent.com/3286990/182946953-0f214b29-1303-4d3e-91f8-3e9c270e8fe6.png)
>
>
> **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 .
>

``

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.