neosemantics

neo4j-labsApache-2.0活跃维护

把 RDF 数据导入导出 Neo4j 的插件,支持 SHACL 校验和模型映射,方便在属性图里玩转语义网和知识图谱。

Graph+Semantics: Import/Export RDF from Neo4j. SHACL Validation, Model mapping and more.... If you like it, please ★ ⇧

2025.06.1发布于 2026-06-16 12:15 UTC974star +2 / 7 天157fork同步于 2026-11-10 23:52 UTC

怎么上手

由 README 提炼,执行前请确认
把 jar 放进 <NEO_HOME>/plugins,并在 neo4j.conf 加:server.unmanaged_extension_classes=n10s.endpoint=/rdf
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Neo4j 的 RDF 插件,让图数据库直接存取和校验语义数据

把 RDF 数据导入导出 Neo4j 的插件,支持 SHACL 校验和模型映射,方便在属性图里玩转语义网和知识图谱。

核心能力

  • 无损导入 RDF 三元组,导出时不丢任何一条
  • 按需把 Neo4j 属性图导出为 RDF
  • 用 W3C SHACL 做模型校验
  • 导入 OWL/RDFS/SKOS 等本体与分类体系
  • 通过 GraphConfig 配置命名空间、多值与类型处理方式

容易踩的坑

这是 Neo4j Labs 实验性项目,不在官方支持产品线内;导入前必须先创建 n10s_unique_uri 唯一约束并初始化 GraphConfig;HTTP 端点需手动加配置并重启才挂载到 /rdf

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本2025.06.1
  1. 2025.06.1Release 2025.06.1最新正式版2026-06-16 · 2026-06-16 12:15 UTC

    Bugfix release for Jackson CVE

  2. 5.26.02025-09-02 · 2025-09-02 11:22 UTC

    这个版本没有写更新说明。

  3. 5.20.02024-06-05 · 2024-06-05 23:49 UTC
    查看更新说明
    • Update to Neo4j 5.20.0
    • exclude apache commons libraries (codec, io, lang3 etc) that are already provided by neo4j
    • update rdf4j to latest version
  4. 5.18.02024-04-05 · 2024-04-05 10:33 UTC
    查看更新说明

    What's changed

    General

    • Upgrade to Neo4j 5.18.0
    • Upgrade to rdf4j 4.3.10
  5. 5.17.02024-03-08 · 2024-03-08 15:45 UTC
    查看更新说明

    What's changed

    General

    • Upgrade to Neo4j 5.17.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    neosemantics (n10s)

    This is an experimental Neo4j Labs project and not part of Neo4j's supported product lineup. See the Neo4j Labs disclaimer. n10s Logo neosemantics is a plugin that enables the use of RDF in Neo4j. RDF is a W3C standard model for data interchange. Some key features of n10s are:

    • Store RDF data in Neo4j in a lossless manner (imported RDF can subsequently be exported without losing a single triple in the process).
    • On-demand export property graph data from Neo4j as RDF.
    • Model validation based on the W3C SHACL language
    • Import of Ontologies and Taxonomies in OWL/RDFS/SKOS/...

    Other features in NSMNTX include model mapping and inferencing on Neo4j graphs.

    ⇨ User Manual and Blog ⇦

    ⇨ Check out the complete user manual with examples of use. ⇦

    ⇨ Blog on neosemantics (and more). ⇦

    Installation

    On Neo4j Desktop

    Select your database, and in the plugins section click on the install button (the most up-to-date compatible version will be shown).

    If you want have the http endpoint mounted on your DB server, you'll need to add the following line to your config.

    server.unmanaged_extension_classes=n10s.endpoint=/rdf
    

    In the desktop you'll be able to do this by clicking on the three dots to the right hand side of your database and then select settings. You can add the fragment at the end of the file.

    On a Neo4j Server

    1. Download the jar file from the releases area and copy it in the <NEO_HOME>/plugins directory of your Neo4j instance.
    2. Add the following line to your <NEO_HOME>/conf/neo4j.conf
      server.unmanaged_extension_classes=n10s.endpoint=/rdf
      
    3. Restart the server.

    Verifying the installation

    You can check that the installation went well by: Running SHOW PROCEDURES WHERE name STARTS WITH "n10s". The list of procedures should include a number of them prefixed by n10s.

    If you installed the http endpoint, you can check it was correctly installed by looking in the logs and making sure they show the following line on startup:

    YYYY-MM-DD HH:MM:SS.000+0000 INFO  Mounted unmanaged extension [n10s.endpoint] at [/rdf]
    

    An alternative way of testing the extension is mounted is by running :GET /rdf/ping on the neo4j browser. This should return the following message

    {"ping":"here!"}
    

    Basic flow

    0. Pre-req: Constraint Creation
    CREATE CONSTRAINT n10s_unique_uri FOR (r:Resource) REQUIRE r.uri IS UNIQUE
    
    1. Creating a Graph Configuration

    Before any RDF import operation a GraphConfig needs to be created. Here we define the way the RDF data is persisted in Neo4j. We'll find things like

    ParamValuesDesc
    handleVocabUris"SHORTEN","KEEP","SHORTEN_STRICT","MAP"how namespaces are handled
    handleMultival"OVERWRITE","ARRAY"how multivalued properties are handled
    handleRDFTypes"LABELS","NODES","LABELS_AND_NODES"how RDF datatypes are handled
    multivalPropList[ list of predicate uris ]
    .........

    Check the complete list in the reference.

    You can create a graph config with all the defaults like this:

    call n10s.graphconfig.init()
    

    Or customize it by passing a map with your options:

    call n10s.graphconfig.init( { handleMultival: "ARRAY", 
                                  multivalPropList: ["http://voc1.com#pred1", "http://voc1.com#pred2"],
                                  keepLangTag: true })
    
    2. Importing RDF data

    Once the Graph config is created we can import data from an url using fetch:

    call n10s.rdf.import.fetch( "https://raw.githubusercontent.com/jbarrasa/neosemantics/3.5/docs/rdf/nsmntx.ttl",
                                "Turtle")
    

    Or pass it as a parameter using inline:

    with '
    @prefix neo4voc: <http://neo4j.org/vocab/sw#> .
    @prefix neo4ind: <http://neo4j.org/ind#> .
    
    neo4ind:nsmntx3502 neo4voc:name "NSMNTX" ;
    			   a neo4voc:Neo4jPlugin ;
    			   neo4voc:runsOn neo4ind:neo4j355 .
    
    neo4ind:apoc3502 neo4voc:name "APOC" ;
    			   a neo4voc:Neo4jPlugin ;		   
    			   neo4voc:runsOn neo4ind:neo4j355 .
    
    neo4ind:graphql3502 neo4voc:name "Neo4j-GraphQL" ;
    			   a neo4voc:Neo4jPlugin ;			   
    			   neo4voc:runsOn neo4ind:neo4j355 .			   			   
    
    neo4ind:neo4j355 neo4voc:name "neo4j" ;
    			   a neo4voc:GraphPlatform , neo4voc:AwesomePlatform .
    
    ' as  payload
    
    call n10s.rdf.import.inline( payload, "Turtle") yield terminationStatus, triplesLoaded, triplesParsed, namespaces
    return terminationStatus, triplesLoaded, triplesParsed, namespaces
    

    It is possible to pass some request specific parameters like headerParams, commitSize, languageFilter... (also found the reference)

    3. Importing Ontologies, QuadRDF, etc

    Same naming scheme applies...

    call n10s.onto.import.fetch(...)
    

    Use autocompletion to discover the different procedures.

    Full documentation will be available soon. In the meantime, please share your feedback in the Neo4j community portal.

    Thanks!