user697911
user697911

Reputation: 10561

Natural Language query on Knowledge Graph

I just get into knowledge graph/ontology area and have a question for query on it.

Knowledge graph/ontology is built in RDF and query on RDF is done by SPARQL language. For example, "Find all subjects with a given object property"

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bc: <http://www.base22.com/ontologies/2010/5/bc.owl#>
SELECT ?subject
WHERE { ?subject bc:hasEmployer <http://www.base22.com/ontologies/2010/5/my-contacts.owl#IBM> } LIMIT 100

I suppose in end applications in this example, the user would make the query "Who work at IBM"? How would I convert such a NL query to the SPARQL query?

In Google's knowledge graph query API, it gives one example:

https://kgsearch.googleapis.com/v1/entities:search?query=taylor+swift&key=API_KEY&limit=1&indent=True

This query returns Swift Taylor's detailed information. I am not sure whether Google Knowledge is also stored as RDF triples and therefore needs SPARQL conversion. Plus, it doesn't give examples of how to query on property restrictions(relations), which seems to be more typical types of queries for RDF data.

Generally, how to query on RDF data using natural languages by end users, not system developer?

Upvotes: 2

Views: 542

Answers (1)

Mohammed Rasheed
Mohammed Rasheed

Reputation: 29

Your question belongs to very active field of research called Question Answering Over Knowledge Graph (QAKG) which utilize Natural Language processing (NLP) methods and techniques to achieve this.

It is a very huge field of research but simply and regrading your Question, in order to convert NL to SPAQRL query you need to make the machine understand the question first tokenize each word identify entities and relations (using NLP task such as NER,NED and POS tagging ...etc) from the question and map them to vocabulary used by the KG/Ontology. and then generate SPARQL query based on the question type.

Upvotes: 0

Related Questions