{"id":13552993,"url":"https://github.com/neo4j-labs/neosemantics","last_synced_at":"2025-05-14T23:05:11.566Z","repository":{"id":9221375,"uuid":"54412018","full_name":"neo4j-labs/neosemantics","owner":"neo4j-labs","description":"Graph+Semantics: Import/Export RDF from Neo4j. SHACL Validation, Model mapping and more.... If you like it, please ★ ⇧","archived":false,"fork":false,"pushed_at":"2025-05-12T15:11:32.000Z","size":10289,"stargazers_count":870,"open_issues_count":142,"forks_count":145,"subscribers_count":42,"default_branch":"5.20","last_synced_at":"2025-05-12T16:29:41.580Z","etag":null,"topics":["knowledge-graph","linked-data","neo4j","ontologies","rdf","semantics","shacl"],"latest_commit_sha":null,"homepage":"https://neo4j.com/labs/neosemantics/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-21T18:14:22.000Z","updated_at":"2025-05-10T14:13:10.000Z","dependencies_parsed_at":"2023-10-17T02:14:55.081Z","dependency_job_id":"09576e6a-1ca2-439d-a65b-4794f07e9ffa","html_url":"https://github.com/neo4j-labs/neosemantics","commit_stats":{"total_commits":607,"total_committers":23,"mean_commits":"26.391304347826086","dds":"0.33278418451400327","last_synced_commit":"eb3b4e69db8e531ffc78acf0504f9179f1202bf5"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneosemantics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneosemantics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneosemantics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneosemantics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j-labs","download_url":"https://codeload.github.com/neo4j-labs/neosemantics/tar.gz/refs/heads/5.20","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243358,"owners_count":22038046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["knowledge-graph","linked-data","neo4j","ontologies","rdf","semantics","shacl"],"created_at":"2024-08-01T12:02:15.048Z","updated_at":"2025-05-14T23:05:06.483Z","avatar_url":"https://github.com/neo4j-labs.png","language":"Java","funding_links":[],"categories":["Java","others"],"sub_categories":[],"readme":"# neosemantics (n10s)\n![n10s Logo](https://guides.neo4j.com/rdf/n10s.png) neosemantics is a plugin that enables the **use of RDF in Neo4j**. [RDF is a W3C standard model](https://www.w3.org/RDF/) for data interchange. Some key features of n10s are:\n\n\n* **Store RDF data in Neo4j** in a\nlossless manner (imported RDF can subsequently be exported without losing a single triple in the process).\n* On-demand **export property graph data** from Neo4j *as RDF*.\n* Model **validation** based on the **W3C SHACL language**\n* Import of **Ontologies and Taxonomies** in **OWL/RDFS/SKOS/...**\n\nOther features in NSMNTX include *model mapping* and *inferencing* on Neo4j graphs.\n\n\n## ⇨ User Manual and Blog ⇦ \n\n⇨ Check out the complete **[user manual](https://neo4j.com/labs/neosemantics/4.0)** with examples of use. ⇦\n\n⇨ [Blog on neosemantics](https://jbarrasa.com/category/graph-rdf/) (and more). ⇦\n\n## Installation\n\n### On Neo4j Desktop\n\nSelect your database, and in the plugins section click on the install button (the most up-to-date compatible version will be shown). \n\n\u003cimg src=\"https://raw.githubusercontent.com/neo4j-labs/rdflib-neo4j/master/img/install-n10s.png\" height=\"400\"\u003e\n\n\nIf you want have the http endpoint mounted on your DB server, you'll need to \nadd the following line to your config. \n\n  ```\n  dbms.unmanaged_extension_classes=n10s.endpoint=/rdf\n  ```\nIn the desktop you'll be able to do this by clicking on the \nthree dots to the right hand side of your database and then select settings. \nYou can add the fragment at the end of the file. \n\n### On a Neo4j Server \n\n1. Download the jar file from the [releases area](https://github.com/neo4j-labs/neosemantics/releases) and copy \nit in the \u003cNEO_HOME\u003e/plugins directory of your Neo4j instance. \n2. Add the following line to your \u003cNEO_HOME\u003e/conf/neo4j.conf\n      ```\n      dbms.unmanaged_extension_classes=n10s.endpoint=/rdf\n      ``` \n3. Restart the server. \n\n\n### Verifying the installation\n\nYou can check that the installation went well by:\nRunning `call dbms.procedures()`. The list of procedures should include a number of them prefixed by **n10s**.\n\nIf you installed the http endpoint, you can check it was correctly installed by looking in \nthe logs and making sure they show the following line on startup:\n```\nYYYY-MM-DD HH:MM:SS.000+0000 INFO  Mounted unmanaged extension [n10s.endpoint] at [/rdf]\n```\n\nAn alternative way of testing the extension is mounted is by running `:GET /rdf/ping` on \nthe neo4j browser. This should return the following message\n```\n{\"ping\":\"here!\"}\n```\n\n\n## Basic flow\n\n####  0. Pre-req: Constraint Creation\n\n``` \nCREATE CONSTRAINT n10s_unique_uri FOR (r:Resource) REQUIRE r.uri IS UNIQUE\n```\n\n#### 1.  Creating a Graph Configuration\nBefore any RDF import operation a `GraphConfig` needs to be created. Here we define the way the RDF data is persisted in Neo4j. \nWe'll find things like \n\n| Param        | Values           | Desc  |\n| :------------- |:-------------|:-----|\n| handleVocabUris     | \"SHORTEN\",\"KEEP\",\"SHORTEN_STRICT\",\"MAP\"|  how namespaces are  handled |\n| handleMultival     | \"OVERWRITE\",\"ARRAY\"      | how multivalued properties are handled |\n| handleRDFTypes | \"LABELS\",\"NODES\",\"LABELS_AND_NODES\"      |  how RDF datatypes are handled |\n| multivalPropList | [ list of predicate uris ] |  |\n| ...| ...|...|\n\nCheck the complete list in [the reference](https://neo4j.com/labs/neosemantics/4.0/reference/). \n\nYou can create a graph config with all the defaults like this:\n``` \ncall n10s.graphconfig.init()\n``` \n\nOr customize it by passing a map with your options:\n``` \ncall n10s.graphconfig.init( { handleMultival: \"ARRAY\", \n                              multivalPropList: [\"http://voc1.com#pred1\", \"http://voc1.com#pred2\"],\n                              keepLangTag: true })\n``` \n\n\n#### 2.  Importing RDF data\n\nOnce the Graph config is created we can import data from a url using `fetch`:\n\n``` \ncall n10s.rdf.import.fetch( \"https://raw.githubusercontent.com/jbarrasa/neosemantics/3.5/docs/rdf/nsmntx.ttl\",\n                            \"Turtle\")\n``` \n\nOr pass it as a parameter using `inline`:\n\n``` \nwith '\n@prefix neo4voc: \u003chttp://neo4j.org/vocab/sw#\u003e .\n@prefix neo4ind: \u003chttp://neo4j.org/ind#\u003e .\n\nneo4ind:nsmntx3502 neo4voc:name \"NSMNTX\" ;\n\t\t\t   a neo4voc:Neo4jPlugin ;\n\t\t\t   neo4voc:runsOn neo4ind:neo4j355 .\n\nneo4ind:apoc3502 neo4voc:name \"APOC\" ;\n\t\t\t   a neo4voc:Neo4jPlugin ;\t\t   \n\t\t\t   neo4voc:runsOn neo4ind:neo4j355 .\n\nneo4ind:graphql3502 neo4voc:name \"Neo4j-GraphQL\" ;\n\t\t\t   a neo4voc:Neo4jPlugin ;\t\t\t   \n\t\t\t   neo4voc:runsOn neo4ind:neo4j355 .\t\t\t   \t\t\t   \n\nneo4ind:neo4j355 neo4voc:name \"neo4j\" ;\n\t\t\t   a neo4voc:GraphPlatform , neo4voc:AwesomePlatform .\n\n' as  payload\n\ncall n10s.rdf.import.inline( payload, \"Turtle\") yield terminationStatus, triplesLoaded, triplesParsed, namespaces\nreturn terminationStatus, triplesLoaded, triplesParsed, namespaces\n``` \n\nIt is possible to pass some request specific parameters like headerParams, commitSize, languageFilter...\n(also found [the reference](https://neo4j.com/labs/neosemantics/4.0/reference/))\n\n\n#### 3.  Importing Ontologies, QuadRDF, etc\n\nSame naming scheme applies...\n\n```\ncall n10s.onto.import.fetch(...)\n```\n\nUse autocompletion to discover the different procedures.\n\nFull documentation will be available soon. In the meantime, please share your feedback in the [Neo4j community portal](https://community.neo4j.com/c/integrations/linked-data-rdf-ontology).\n\nThanks! \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-labs%2Fneosemantics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j-labs%2Fneosemantics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-labs%2Fneosemantics/lists"}