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

convert Haystack JSON model #57

Open
jli113 opened this issue Jul 12, 2021 · 2 comments · May be fixed by #63
Open

convert Haystack JSON model #57

jli113 opened this issue Jul 12, 2021 · 2 comments · May be fixed by #63

Comments

@jli113
Copy link

jli113 commented Jul 12, 2021

After downloading bravo.json, running the following lines:

import json
from brickschema import Graph
model = json.load(open("bravo.json"))
g = Graph(load_brick=True).from_haystack("http://project-haystack.org/bravo#", model)

File "C:\Users*\anaconda3\envs\Brick\lib\site-packages\brickschema\inference.py", line 711, in
entities = {e["id"].replace('"', ""): {"tags": e} for e in entities}

AttributeError: 'dict' object has no attribute 'replace'

@gtfierro
Copy link
Member

Aha! This is due to Haystack changing the encoding of id fields in their JSON exports; I will push a fix for this soon

The ids used to look like: {"id": "0001"} but now they look like {"id": {"_kind": "ref", "dis": "0001", "val": "0001"}}

@gtfierro
Copy link
Member

Upon further investigation, many aspects of the Haystack JSON export have changed, requiring a deeper rewrite of the Haystack to Brick translation module

@gtfierro gtfierro linked a pull request Jul 22, 2021 that will close this issue
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 a pull request may close this issue.

2 participants