Skip to content

Conversation

@ubyndr
Copy link
Collaborator

@ubyndr ubyndr commented Sep 15, 2025

Consolidate author cell-type annotations into one JSON blob per CellSet and attach it via the RDF predicate ns.author_cell_type_annotations.

Why

  • Simpler, key-agnostic querying downstream (esp. Neo4j with APOC).
  • Fewer triples and less schema churn than per-key predicates.
  • Keeps a single namespace (self.ns).

What changed

  • Build a payload from inner_dict including only author keys.

  • After the per-resource loop, write one triple:

    self.graph.add(
        (resource,
         self.ns.author_cell_type_annotations,
         Literal(json.dumps(payload, ensure_ascii=False)))
    )

Before vs After

Before (multiple triples):

ex:cell a ex:CellSet ;
  ex:subclass.full "Cycling Connecting Tubule Cell" ;
  ex:subclass.l2   "cycCNT" ;
  ex:subclass.l3   "cycCNT" .

After (single JSON triple):

ex:cell a ex:CellSet ;
  ex:author_cell_type_annotations
    "{\"subclass.full\":\"Cycling Connecting Tubule Cell\",\"subclass.l2\":\"cycCNT\",\"subclass.l3\":\"cycCNT\"}" .

@ubyndr ubyndr requested a review from dosumis September 15, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants