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

apis-entities: disable enrich uri for default URI #1438

Closed
gythaogg opened this issue Nov 22, 2024 · 5 comments · Fixed by #1443
Closed

apis-entities: disable enrich uri for default URI #1438

gythaogg opened this issue Nov 22, 2024 · 5 comments · Fixed by #1443
Assignees
Labels
feature-request Request for adaptation of existing functionality or new feature

Comments

@gythaogg
Copy link
Contributor

I think it doesn't make sense to enrich an entity with itself - which is what happens if we call the enrich endpoint with default URI that is created when the entity is created...

https://github.com/acdh-oeaw/apis-core-rdf/blob/main/apis_core/apis_entities/templates/apis_entities/partials/linked_open_data.html#L8C1-L9C1

<h5 class="card-title">Linked Open Data</h5>
{% if object.uri_set %}
  <ul>
    {% for uri in object.uri_set.all %}
      <li>
        {{ uri.uri | urlize }}
        {% if object.get_change_permission in perms %}
          <a href="{{ object.get_enrich_url }}?uri={{ uri.uri }}"><span class="material-symbols-outlined">update</span></a>
        {% endif %}
      </li>
    {% endfor %}
  </ul>
{% endif %}
@gythaogg gythaogg added the feature-request Request for adaptation of existing functionality or new feature label Nov 22, 2024
@koeaw
Copy link
Contributor

koeaw commented Dec 2, 2024

For me, a click on the "... merge data" link (previously: enrich icon) on a local object actually results in weird template output:

Screenshot 2024-12-02 at 18-12-00 Heldenplatz

(Not sure if that's what you meant anyway since you didn't spell it out and this isn't labelled a bug Something isn't working (properly, as expected, at all) ; adding this just in case.)

@gythaogg
Copy link
Contributor Author

gythaogg commented Dec 2, 2024

This is because the default URL created when the object is created is wrong, I think. It's wrong in most APIS instances, as far as I know.

I wouldn't call it a big in the code but in the configuration and consequently the data. The default base URL for all APIS entities comes from the Django settings

@b1rger b1rger self-assigned this Dec 2, 2024
@b1rger
Copy link
Contributor

b1rger commented Dec 2, 2024

This is because the default URL created when the object is created is wrong, I think. It's wrong in most APIS instances, as far as I know.

I wouldn't call it a big in the code but in the configuration and consequently the data. The default base URL for all APIS entities comes from the Django settings

The default APIS_BASE_URI is set to the value of PUBLIC_URL, if exists, since default-settings 1.3. This should be the right choice for most of the APIS instances at the ACDH

@b1rger
Copy link
Contributor

b1rger commented Dec 2, 2024

For me, a click on the "... merge data" link (previously: enrich icon) on a local object actually results in weird template output:

Screenshot 2024-12-02 at 18-12-00 Heldenplatz

(Not sure if that's what you meant anyway since you didn't spell it out and this isn't labelled a bug Something isn't working (properly, as expected, at all) ; adding this just in case.)

This is simply the error message, which clearly could be more verbose. It tried to fetch data from the URI /entity/3, but that only led to an empty dict, so it could not import anything from there.

@gythaogg
Copy link
Contributor Author

gythaogg commented Dec 3, 2024

The default APIS_BASE_URI is set to the value of PUBLIC_URL, if exists, since default-settings 1.3. This should be the right choice for most of the APIS instances at the ACDH

Oops, I get an error because I have a misconfigured APIS_BASE_URI in my settings. Once I remove it, it does indeed work! Sorry for blaming acdhch settings...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for adaptation of existing functionality or new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants