-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from erc-releven/lupl/starlegs-decouple-graph-c…
…onstructor feat: Decouple starlegs constructor from custom data structure
- Loading branch information
Showing
4 changed files
with
41 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
"""Custom types for starlegs functionality.""" | ||
|
||
from dataclasses import dataclass | ||
from string import Template | ||
from collections import UserString | ||
|
||
|
||
@dataclass | ||
class CRMTemplateMap: | ||
"""Simple dataclass for associating a construct template with applicable CRM classes.""" | ||
class StarlegsQuery(UserString): | ||
"""UserString which can hold additional metadata in a Namespace. | ||
sparql_construct_template: Template | ||
crm_classes: list[str] | ||
Intended for Starlegs SPARQL queries. | ||
""" | ||
|
||
def __init__(self, data: str, **metadata): | ||
self.data: str = data | ||
self.metadata: dict = metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters