# NLP Knowledge Graph Tutorial

**URL:** <https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485>\
**Category:** Procedures & APOC\
**Created:** [October 26, 2021, 4:46pm UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485 "2021-10-26T16:46:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aduron](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/aduron/32/20620_2.png) [@aduron](https://community.neo4j.com/u/aduron)\
**Post date:** [October 26, 2021, 4:46pm UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485/1 "2021-10-26T16:46:39Z")

</div>

I'm going through the tutorial at [Tutorial: Build a Knowledge Graph using NLP and Ontologies - Developer Guides](https://neo4j.com/developer/graph-data-science/build-knowledge-graph-nlp-ontologies/)

Once I get to slide 15 I'm getting a no changes, no records. Possibly something to do with HAS\_ENTITY? Any help appreciated thanks:

MATCH (c:Category {name: "NoSQL database management system"})  
CALL n10s.inference.nodesInCategory(c, {  
inCatRel: "ABOUT",  
subCatRel: "SUB\_CAT\_OF"  
})  
YIELD node  
MATCH (node)\<-[:HAS\_ENTITY]-(article)  
RETURN article.uri AS uri, article.title AS title, article.datetime AS date,  
collect(n10s.rdf.getIRILocalName(node.uri)) as explicitTopics  
ORDER BY date DESC  
LIMIT 5;

- neo4j desktop version 1.4.8
- which plugins / extensions / procedures do you use: APOC, n10s

---

<div class="post-metadata">

**Author:** ![sameer.gijare14](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sameer.gijare14/32/11986_2.png) [@sameer.gijare14](https://community.neo4j.com/u/sameer.gijare14)\
**Post date:** [October 28, 2021, 4:07am UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485/2 "2021-10-28T04:07:12Z")

</div>

Hello

Please install GDS plugin that is compatible with desktop version that you have installed.

Thanking you  
Sameer Sudhir G

---

<div class="post-metadata">

**Author:** ![sameer.gijare14](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sameer.gijare14/32/11986_2.png) [@sameer.gijare14](https://community.neo4j.com/u/sameer.gijare14)\
**Post date:** [October 28, 2021, 4:17am UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485/3 "2021-10-28T04:17:52Z")

</div>

Also install neosemantics 10s plugin  
and load RDF Taxonomy into Project DB engine. After that you can use sparkle Query to extract RDF triplets (documents from Marklogic). But may be you will need to apply transformation logic of your own embedded inside a plugin to achieve whatever your goal is.

Thanking you  
Sameer Sudhir G

---

<div class="post-metadata">

**Author:** ![DMF194](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dmf194/32/20924_2.png) [@DMF194](https://community.neo4j.com/u/DMF194)\
**Post date:** [February 25, 2022, 8:48am UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485/4 "2022-02-25T08:48:34Z")

</div>

Hi there,

I have also started following at [Tutorial: Build a Knowledge Graph using NLP and Ontologies - Developer Guides](https://neo4j.com/developer/graph-data-science/build-knowledge-graph-nlp-ontologies/).

Able to following along with no issues until the part where I need to import RDF from WikiData

```auto
WITH "https://query.wikidata.org/sparql?query=prefix%20neo%3A%20%3Cneo4j%3A%2F%2Fvoc%23%3E%20%0A%23Cats%0A%23SELECT%20%3Fitem%20%3Flabel%20%0ACONSTRUCT%20%7B%0A%3Fitem%20a%20neo%3ACategory%20%3B%20neo%3AsubCatOf%20%3FparentItem%20.%20%20%0A%20%20%3Fitem%20neo%3Aname%20%3Flabel%20.%0A%20%20%3FparentItem%20a%20neo%3ACategory%3B%20neo%3Aname%20%3FparentLabel%20.%0A%20%20%3Farticle%20a%20neo%3AWikipediaPage%3B%20neo%3Aabout%20%3Fitem%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%0A%7D%0AWHERE%20%0A%7B%0A%20%20%3Fitem%20(wdt%3AP31%7Cwdt%3AP279)*%20wd%3AQ2429814%20.%0A%20%20%3Fitem%20wdt%3AP31%7Cwdt%3AP279%20%3FparentItem%20.%0A%20%20%3Fitem%20rdfs%3Alabel%20%3Flabel%20.%0A%20%20filter(lang(%3Flabel)%20%3D%20%22en%22)%0A%20%20%3FparentItem%20rdfs%3Alabel%20%3FparentLabel%20.%0A%20%20filter(lang(%3FparentLabel)%20%3D%20%22en%22)%0A%20%20%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%20%20%3Farticle%20schema%3Aabout%20%3Fitem%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20schema%3AinLanguage%20%22en%22%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%0A%20%20%20%20%7D%0A%20%20%0A%7D" AS softwareSystemsUri
CALL n10s.rdf.import.fetch(softwareSystemsUri, 'Turtle' , { headerParams: { Accept: "application/x-turtle" } })
YIELD terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams
RETURN terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams;

```

For whatever reason, the result is KO

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/b/8/b8a49208320ba699ffcdb47adf7d09d57e89034d.png)

I have also added the line below in my neo4j.config file

```auto
dbms.unmanaged_extension_classes=n10s.endpoint=/rdf

```

OS: Windows10  
Neo4j: 1.4.11  
neosemantic: 4.4.0  
apoc-nlp-dependencies-4.4.0.3jar

Any suggestions would be advised.

---

<div class="post-metadata">

**Author:** ![sameer.gijare14](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sameer.gijare14/32/11986_2.png) [@sameer.gijare14](https://community.neo4j.com/u/sameer.gijare14)\
**Post date:** [February 25, 2022, 5:11pm UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485/5 "2022-02-25T17:11:28Z")

</div>

Hello

As a remote observer I noticed that you are using SparkQL.Have you imported necessary ontologies for that? I guess there is a separate ontology for with name like rdf triples.Its just a guess but anyways you are the best judge for your Neo4j desktop.

Many thanks  
Mr Sameer Sudhir Gijare

---

<div class="post-metadata">

**Author:** ![DMF194](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dmf194/32/20924_2.png) [@DMF194](https://community.neo4j.com/u/DMF194)\
**Post date:** [February 28, 2022, 1:46am UTC](https://community.neo4j.com/t/nlp-knowledge-graph-tutorial/46485/6 "2022-02-28T01:46:47Z")

</div>

HI @sameer.gijare14,

Yes I am using SparkQL from WikiData

Based on my current understanding, the code below is used to import taxonomies from Software Systems using the WikiData API

```auto
WITH "https://query.wikidata.org/sparql?query=prefix%20neo%3A%20%3Cneo4j%3A%2F%2Fvoc%23%3E%20%0A%23Cats%0A%23SELECT%20%3Fitem%20%3Flabel%20%0ACONSTRUCT%20%7B%0A%3Fitem%20a%20neo%3ACategory%20%3B%20neo%3AsubCatOf%20%3FparentItem%20.%20%20%0A%20%20%3Fitem%20neo%3Aname%20%3Flabel%20.%0A%20%20%3FparentItem%20a%20neo%3ACategory%3B%20neo%3Aname%20%3FparentLabel%20.%0A%20%20%3Farticle%20a%20neo%3AWikipediaPage%3B%20neo%3Aabout%20%3Fitem%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%0A%7D%0AWHERE%20%0A%7B%0A%20%20%3Fitem%20(wdt%3AP31%7Cwdt%3AP279)*%20wd%3AQ2429814%20.%0A%20%20%3Fitem%20wdt%3AP31%7Cwdt%3AP279%20%3FparentItem%20.%0A%20%20%3Fitem%20rdfs%3Alabel%20%3Flabel%20.%0A%20%20filter(lang(%3Flabel)%20%3D%20%22en%22)%0A%20%20%3FparentItem%20rdfs%3Alabel%20%3FparentLabel%20.%0A%20%20filter(lang(%3FparentLabel)%20%3D%20%22en%22)%0A%20%20%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%20%20%3Farticle%20schema%3Aabout%20%3Fitem%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20schema%3AinLanguage%20%22en%22%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%0A%20%20%20%20%7D%0A%20%20%0A%7D" AS softwareSystemsUri
CALL n10s.rdf.import.fetch(softwareSystemsUri, 'Turtle' , { headerParams: { Accept: "application/x-turtle" } })
YIELD terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams
RETURN terminationStatus, triplesLoaded, triplesParsed, namespaces, callParams;

```

As you said I am using the Neo4j Desktop and I am using the Neosemantics plugin in Neo4j Desktop to import the taxonomy

Is there an updated document on this as I feel it does not provide a complete picture?
