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

RE: IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed #326

Open
fridayorji opened this issue Sep 27, 2023 · 0 comments

Comments

@fridayorji
Copy link

I'm submitting a

  • [ **] bug report.

Current Behaviour:

I 'm trying to generate rdf files as follows:

config = f"""
[DataSource1]
mappings=rules2.r2rml.ttl
db_url=mysql+pymysql://root:Kaboyacci3143@localhost/webgov
"""

import kglab

namespaces = {
"rv": "http://WebGov.RiversState.gov.ng/"
}

kg = kglab.KnowledgeGraph(
name = "RV WebGov KG",
namespaces = namespaces
)

kg.materialize(config)

save RDF as ttl

kg.save_rdf("rules2_rdf-triples.ttl")

save RDF as jsonld

kg.save_jsonld("rules2_rdf-triples.jsonld")

But I get "RE: IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed" error

Expected Behaviour:

Generate the rdf files without the index error

Steps to reproduce:

My yml file, from which the mapping file is generated, is given as follows:

prefixes:
rv: "http://WebGov.RiversState.gov.ng/"

sources:
citizen:
queryFormulation: mysql
query: select * from citizen right join child_birth on citizen.citizenid = child_birth.experiencedby left join birth_reg on child_birth.child_birthid = birth_reg.associatedwith;

mappings:
citizenm:
sources: citizen
s: http://WebGov.RiversState.gov.ng/$(citizenid)
po:
- [a, rv:citizen]
- [rv:firstname, $(FirstName)]
- [rv:lastname, $(LastName)]
- [rv:dateofbirth, $(Date_Of_Birth)]
- [rv:sex, $(Sex)]
- p: rv:experiences
o:
- mapping: child_birth
condition:
function: equal
parameters:
- [str1, $(child_birthid)]
- [str2, $(child_birthid)]
child_birth:
sources: citizen
s: http://WebGov.RiversState.gov.ng/$(child_birthid)
po:
- [a, rv:child_birth]
- [rv:placeofevent, $(PlaceOfEvent)]
- [rv:dateofevent, $(DateOfEvent)]
- [rv:experiencedby, $(citizenid)]
- [rv:child_birthid, $(child_birthid)]

Snapshot:

Environment:

  • python version 3.9.12
  • pip version: 23.2.1
  • OS details: Windows 10
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

No branches or pull requests

1 participant