Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neat 334 asset loader graph store interface #542

Merged
merged 53 commits into from
Jul 17, 2024

Conversation

nikokaoja
Copy link
Collaborator

@nikokaoja nikokaoja commented Jul 15, 2024

[0.87.0] - 17-07-24

Added

  • AssetLoader added to load assets to CDF
  • get_default_prefixes method to provide default prefixes

Removed

  • PREFIXES dict that was used as default prefixes in NeatGraphStore and Rules

Improved

  • AssetRules properties have now mandatory implementation field

Fixed

  • Issue of properties not being renamed in DESCRIBE query

@doctrino doctrino self-requested a review July 17, 2024 11:44
Copy link
Collaborator

@doctrino doctrino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments.

One suggestion: What about renaming it to _rdf2class and then have the loader create both Assets and Relationships.

cognite/neat/graph/queries/_shared.py Outdated Show resolved Hide resolved
cognite/neat/graph/queries/_shared.py Outdated Show resolved Hide resolved
Comment on lines -12 to -15
_DEXPI_PREFIXES = {
"dexpi": Namespace("http://sandbox.dexpi.org/rdl/"),
"posccaesar": Namespace("http://data.posccaesar.org/rdl/"),
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice another one

cognite/neat/legacy/graph/stores/_base.py Outdated Show resolved Hide resolved
cognite/neat/rules/models/asset/_rules.py Outdated Show resolved Hide resolved
cognite/neat/rules/models/information/_rules.py Outdated Show resolved Hide resolved
cognite/neat/graph/loaders/_rdf2asset.py Outdated Show resolved Hide resolved
cognite/neat/graph/loaders/_rdf2asset.py Outdated Show resolved Hide resolved
@@ -104,6 +134,39 @@ def categorize_assets(self, client: CogniteClient) -> None:

raise NotImplementedError("Not implemented yet, this is placeholder")

def _load(self, stop_on_exception: bool = False) -> Iterable[AssetWrite | NeatIssue]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such a nice method. Really like how easy it is with the store.read

Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
Co-authored-by: Anders Albert <60234212+doctrino@users.noreply.github.com>
@nikokaoja nikokaoja merged commit bb78366 into main Jul 17, 2024
7 checks passed
@nikokaoja nikokaoja deleted the NEAT-334-AssetLoader-graph-store-interface branch July 17, 2024 13:08
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