-
Notifications
You must be signed in to change notification settings - Fork 8
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
NamespaceManager #21
Comments
Hi @a1012, There seems to be two issues. First, you need to import NamespaceManager before you can use it: Second, the CSV that you attached won't convert to RDF with the code you shared. You need to use Hope it helps. |
Hi @cadmiumkitty I didn't understand the format in the shared(This is probably a good example: https://github.com/cadmiumkitty/anzsic-taxonomy/blob/main/anzsic.csv) example. So could you please provide any material to understand the rdf format(what each identifier or terminology mean ) to create for my use-case . I mean , I am not able to understand the structure and how to put in my use-case.
I usually get error: |
Hi @a1012, I'd start with RDF Primer here https://www.w3.org/TR/rdf11-concepts/ My second point is that the CSV that you read into Pandas DataFrame to convert to Rdflib Graph and serialize as Turtle (.ttl) should follow a particular convention. The convention is described in the documentation for the to_graph method: https://rdfpandas.readthedocs.io/en/latest/rdfpandas.html#rdfpandas.graph.to_graph Row indices are used as subjects, and column indices as predicates (I use The example I shared https://github.com/cadmiumkitty/anzsic-taxonomy/blob/main/anzsic.csv follows that convention in that it has |
@cadmiumkitty
Hi, I am trying to convert pandas dataframe(.csv format) to rf graph in .ttl format.
While converting, I am facing an issue:
NameError: name 'NamespaceManager' is not defined
The code I am using is :
`from rdfpandas.graph import to_graph
import pandas as pd
import rdflib
df = pd.read_csv('/content/sample_data/NER_test.csv', keep_default_na = False)
namespace_manager = NamespaceManager(Graph())
namespace_manager.bind('skos', SKOS)
namespace_manager.bind('rdfpandas', Namespace('http://github.com/cadmiumkitty/rdfpandas/'))
g = to_graph(df, namespace_manager)
s = g.serialize(format = 'turtle')`
The csv file file is attached:
NER_test.csv
Please help me for the same. Moreover, I will be using generated file to interact with BioCypher.
The text was updated successfully, but these errors were encountered: