ƒxyzƒxyz Docs
The NetworkTechnologyData Tools

Neosemantics (n10s)

Neo4j plugin for RDF and semantic web integration in ƒxyz Network

Neosemantics (n10s) is a Neo4j plugin that maps RDF (Resource Description Framework) and its vocabularies (OWL, RDFS, SKOS) into Neo4j's property graph model. It bridges W3C-standard RDF ontologies and the native graph storage used by ƒxyz Network.

Configuration

Graph config controls how URIs, labels, and multi-valued properties are stored in Neo4j. The current configuration uses:

CALL n10s.graphconfig.show()

Key settings:

SettingValueMeaning
handleVocabUrisMAPPrefix-mapped URIs stored as short names (e.g. fxyz:Member)
handleMultivalARRAYMulti-valued RDF properties stored as arrays
handleRDFTypesLABELS_AND_NODESRDF types become both Neo4j labels and linked nodes
keepLangTagfalseLanguage tags stripped from literals
keepCustomDataTypesfalseCustom XSD types coerced to native Neo4j types

To initialise a fresh database with these settings:

CALL n10s.graphconfig.init({
  handleVocabUris: 'MAP',
  handleMultival: 'ARRAY',
  handleRDFTypes: 'LABELS_AND_NODES'
})

Registered Namespaces

All active namespace prefixes are stored in the _NsPrefDef node. List them with:

CALL n10s.nsprefixes.list()
YIELD prefix, namespace
RETURN prefix, namespace
ORDER BY prefix

Key prefixes used in ƒxyz Network:

PrefixNamespace
fxyzhttps://fxyz.network/ontology/
fibohttps://spec.edmcouncil.org/fibo/ontology/
owlhttp://www.w3.org/2002/07/owl#
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfshttp://www.w3.org/2000/01/rdf-schema#
skoshttp://www.w3.org/2004/02/skos/core#
xsdhttp://www.w3.org/2001/XMLSchema#

Add a new prefix before any import that references an unmapped namespace:

CALL n10s.nsprefixes.add('fxyz', 'https://fxyz.network/ontology/')

RDF Export

Use n10s.rdf.export.cypher() to serialise a subgraph as RDF. The procedure accepts a Cypher query and a format string.

Export all Member nodes and their outgoing relationships as Turtle:

CALL n10s.rdf.export.cypher(
  "MATCH (m:Member)-[r]->(t) RETURN m, r, t",
  "Turtle"
)
YIELD payload
RETURN payload

Export a single concept node as JSON-LD for DKG publishing:

CALL n10s.rdf.export.cypher(
  "MATCH (c:Concept {uri: 'https://fxyz.network/entity/concept/fx-spot'})
   OPTIONAL MATCH (c)-[r]->(related)
   RETURN c, r, related",
  "JSON-LD"
)
YIELD payload
RETURN payload

The payload field contains the serialised RDF string. Supported format strings: "Turtle", "N-Triples", "JSON-LD", "RDF/XML", "TriG".

RDF Import

Use n10s.rdf.import.fetch() to pull an RDF document from a URL directly into the graph. This is the standard path for FIBO ontology updates.

Import a FIBO module (Turtle format):

CALL n10s.rdf.import.fetch(
  'https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/FinancialProductsAndServices/',
  'Turtle',
  { commitSize: 5000, verifyUriSyntax: false }
)
YIELD terminationStatus, triplesLoaded, triplesParsed, namespaces, extraInfo
RETURN terminationStatus, triplesLoaded, triplesParsed

For inline RDF strings, use n10s.rdf.import.inline():

CALL n10s.rdf.import.inline(
  '@prefix fxyz: <https://fxyz.network/ontology/> .
   fxyz:spot-market a fxyz:MarketSegment ;
     rdfs:label "Spot Market" .',
  'Turtle'
)
YIELD terminationStatus, triplesLoaded
RETURN terminationStatus, triplesLoaded

After import, verify the loaded triples with:

MATCH (n:_NsPrefDef) RETURN n

Supported Formats

FormatStringNotes
Turtle"Turtle"Preferred for human-readable ontology files
N-Triples"N-Triples"Line-by-line, streaming-friendly
JSON-LD"JSON-LD"Used for DKG publishing and API responses
RDF/XML"RDF/XML"Required for some FIBO modules
TriG"TriG"Named graphs, used for assertion partitioning

N-Quads is NOT supported by the n10s version deployed in ƒxyz Network. Use TriG for named-graph scenarios instead.

URI Scheme

All ƒxyz entities have resolvable URIs following a consistent pattern:

Entity typeURI patternExample
Memberhttps://fxyz.network/entity/member/{did}.../member/did:privy:cmeh4kr8
Concepthttps://fxyz.network/entity/concept/{slug}.../concept/fx-spot
Paperhttps://fxyz.network/entity/paper/{id}.../paper/arxiv-2301.00001
Circlehttps://fxyz.network/entity/circle/{id}.../circle/trading-ops
Ontology classhttps://fxyz.network/ontology/{Class}.../ontology/Member
Ontology propertyhttps://fxyz.network/ontology/{prop}.../ontology/memberLevel

The entity/ path is for data instances; the ontology/ path is for schema definitions. Both are registered in the n10s namespace registry under the fxyz prefix.

For more details, see the neosemantics documentation.

On this page