Skip to content

Conversation

@apdavison
Copy link
Member

fairgraph classes now inherit directly from their openMINDS-Python equivalents, which means they gain the ability to serialise instances to local JSON-LD files. In addition, this removes small inconsistencies in behaviour between openMINDS-Python and fairgraph, so that transitioning to fairgraph when you're ready to work with the KG should be very straightforward.

apdavison added 26 commits June 20, 2024 10:54
* master: (42 commits)
  update openminds module from most recent schemas
  handle a possible KG API error, where specifying an instance_id that doesn't exist in a query behaves as if no instance_id was specified (whereas we would expect no instances to be returned)
  Include "space" property for all nodes in multi-node (following) query
  Fix a problem with query generation when using "type_filter" or "reverse" with a multi-part path.
  add error handling for `client.instance_from_full_uri()` method
  fixes to LivePaperResourceItem
  Make `client.space_info()` and `client.clean_space()` more robust
  fix test data
  Added "get_property()" class method to the ContainsMetadata class
  client.spaces() returned only the first 100 spaces. This fixes that for the few people who have more than 100 spaces.
  Added Stan photo
  Added "Writing to the Knowledge Graph" section
  set kernel for EBRAINS Lab
  first draft
  remove outdated notebooks
  update openminds module from most recent schemas
  Attempt at pre-emptive support for queries using the new openMINDS namespace (v4)
  support for the openMINDS namespace transition, the idea being to support both namespaces, at least temporarily
  cleanup of context handling
  update to generation script for openminds module, to work with new namespaces
  ...

# Conflicts:
#	builder/fairgraph_module_template.py.txt
#	builder/update_openminds.py
#	fairgraph/base.py
#	fairgraph/client.py
#	fairgraph/kgobject.py
#	fairgraph/properties.py
#	fairgraph/queries.py
#	fairgraph/registry.py
#	test/test_base.py
…e conversions (needed until KG is migrated to v4) happen inside KGClient
…rgraph instances.

The previous approach of initialising the instances as each module was imported, implemented in [b25091a] and [e4df6ff], has the problem that it prematurely triggers the resolution of types (in Property definitions) from strings to classes, and so the properties retain the openMINDS classes rather than getting the fairgraph ones.

The new approach leaves initialisation of instances until after all modules have been imported and the registry correctly set up.

This also reverts [5853d18], since those changes are not needed if all classes are properly initialised.
… property names.

This catches the common case of mis-spelling property names, or wrongly guessing, e.g., using "authors" when it should be "developers"
* master:
  fix test failures when running full test suite, since changes in one test carry over to others

# Conflicts:
#	fairgraph/base.py
@apdavison apdavison added the enhancement New feature or request label Nov 3, 2025
@apdavison apdavison merged commit 4d38712 into HumanBrainProject:master Nov 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant