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

CSV to RDF KG and back #93

Open
Demirrr opened this issue Nov 5, 2024 · 2 comments
Open

CSV to RDF KG and back #93

Demirrr opened this issue Nov 5, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Demirrr
Copy link
Member

Demirrr commented Nov 5, 2024

We should implement two features that one transforms a CSV file into RDF Knowledge Graph (KG) and the other transforms RDF KG into a CSV file.

Let's take a look at the transformation from a CSV file into RDF KG

  1. The i-th row represents the first hop information (simplified CBD) of the i-th owl named individual.
  2. A column represents a property (data property or type).
  3. A value represents either a Literal or an OWL Class.

CSV Datasets: datasets from sklearn and fairlearn

@Demirrr Demirrr self-assigned this Nov 5, 2024
@Demirrr Demirrr added the enhancement New feature or request label Nov 5, 2024
@LckyLke
Copy link
Collaborator

LckyLke commented Dec 15, 2024

I also added the kg to csv functionality (ie the inverse of csv to kg) here.

I also thought that maybe it makes sense to treat values that are strings and maybe are given as a parameter as type assertions:

https://github.com/dice-group/owlapy/blob/7972d4f6946c6597a59fbb7197d1c22ffc352230/owlapy/util_owl_static_funcs.py#L117C1-L126C67

For instance if we look at the following data - if a user says that genre is a type assertion this would create the kg graph accordingly:

Movie Title Genre Rating Release Year Duration (mins) Director IMDb Score
The Shawshank Redemption Drama R 1994 142 Frank Darabont 9.3

RDF Graph Representation

Node: :individual_0
Type: :Drama

data Properties:

  • :hasTitle"The Shawshank Redemption"
  • :hasRating"R"
  • :hasReleaseYear1994^^xsd:gYear
  • :hasDuration142^^xsd:integer
  • :hasDirector"Frank Darabont"
  • :hasIMDbScore9.3^^xsd:float

@LckyLke
Copy link
Collaborator

LckyLke commented Dec 15, 2024

also maybe it would make sense to allow for a column to set the individual URI?
-> if using the title here this would lead to http://example.org/#the_shawshank_redemption

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

No branches or pull requests

2 participants