Neosemantics connects RDF and semantic-web vocabularies with Neo4j’s labeled-property-graph model, enabling ontology data to be imported, normalized, queried, and used for basic inference. section 3.2
A practical ontology-ingestion pipeline includes:
- Create the Neo4j database, then add uniqueness constraints and indexes for resource, phenotype, and disease identifiers. section 3.3.1
- Initialize graph configuration, ignore vocabulary namespaces when required, and convert imported relationship types to Neo4j naming conventions. section 3.3.1
- Import an RDF/XML ontology, enrich resource nodes with domain labels and identifiers, and load annotation data as disease-to-phenotype relationships. section 3.3.1 section 7.6.4
- Apply inference over subclass hierarchies to retrieve disease associations that are implicit rather than directly connected. section 3.5
Listing 3.15 Configuring the Neosemantics plugin
CALL n10s.graphconfig.init();
CALL n10s.graphconfig.set({ handleVocabUris: "IGNORE" });
CALL n10s.graphconfig.set({ applyNeo4jNaming: True });
Inspect the Cypher configuration that initializes Neosemantics and controls vocabulary URI handling and relationship naming. section 3.3.1
Listing 3.28 Finding phenotypic features related to the abnormality subclasses
MATCH (cat:HpoPhenotype {label: "Abnormality of the endocrine system"}) #1
CALL n10s.inference.nodesInCategory(cat, {
inCatRel: "HAS_PHENOTYPIC_FEATURE",
subCatRel: "SUBCLASSOF"}) #2
YIELD node as dis
WHERE dis.label IN [
"Congenital atransferrinemia",
"Deafness, autosomal recessive 4, with enlarged vestibular aqueduct",
"Diabetes mellitus, transient neonatal, 1",
"Edema, familial idiopathic, prepubertal",
"Familial dysalbuminemic hyperthyroxinemia"
] #3
MATCH (dis)-[:HAS_PHENOTYPIC_FEATURE]->(phe:HpoPhenotype) #4
RETURN dis.label as disease, collect(DISTINCT phe.label) as features
ORDER BY size(features) ASC, disease
Inspect the inference procedure that expands a phenotypic category through subclass relationships and returns associated disease features. section 3.5
