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

fix bug with creating json-ld with url datatypes, re #9190 #10657

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

apeters
Copy link
Member

@apeters apeters commented Mar 6, 2024

re #9190

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good at this layer, but in retesting the bug report I found a failure later on in the same workflow, which I figure we should also address:

Request Method: GET
Request URL: http://127.0.0.1:8029/resources/139342ee-f035-44c1-8c6a-821ecb26977d

Django Version: 4.2.10
Python Version: 3.11.6

  File "/web_root/arches/arches/app/views/api.py", line 511, in get
    output = exporter.writer.write_resources(resourceinstanceids=[resourceid], indent=indent, user=request.user)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/web_root/arches/arches/app/utils/data_management/resources/formats/rdffile.py", line 275, in write_resources
    js = self.build_json(graph_id, resourceinstanceids, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/web_root/arches/arches/app/utils/data_management/resources/formats/rdffile.py", line 238, in build_json
    g = self.get_rdf_graph()
        ^^^^^^^^^^^^^^^^^^^^
  File "/web_root/arches/arches/app/utils/data_management/resources/formats/rdffile.py", line 211, in get_rdf_graph
    add_edge_to_graph(g, domainnode, rangenode, edge, tile, graph_info)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/web_root/arches/arches/app/utils/data_management/resources/formats/rdffile.py", line 166, in add_edge_to_graph
    graph.add((pkg["d_uri"], RDF.type, URIRef(edge.domainnode.ontologyclass)))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/web_root/ENV/lib/python3.11/site-packages/rdflib/term.py", line 223, in __new__
    if not _is_valid_uri(value):
           ^^^^^^^^^^^^^^^^^^^^
  File "/web_root/ENV/lib/python3.11/site-packages/rdflib/term.py", line 76, in _is_valid_uri
    if c in uri: return False
       ^^^^^^^^

Exception Type: TypeError at /resources/139342ee-f035-44c1-8c6a-821ecb26977d
Exception Value: argument of type 'NoneType' is not iterable

@apeters
Copy link
Member Author

apeters commented Mar 6, 2024

Hmm, that's interesting. I did not experience that issue. I was able to create a card with 2 url nodes, populate only one of them and successfully return a json-ld doc. @jacobtylerwalls maybe we should compare setups, test models, etc...?

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked into this further, and this was a red-herring error from not having an ontology on my graph. We can consider raising a more informative error for that separately.

@jacobtylerwalls jacobtylerwalls merged commit b5a5cb6 into dev/7.5.x Mar 6, 2024
2 checks passed
@jacobtylerwalls jacobtylerwalls deleted the 9190_url_json_ld_fix branch March 6, 2024 20:28
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 this pull request may close these issues.

2 participants