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

question(relations): should there be a create option in the subj/obj autocomplete? #1364

Closed
gythaogg opened this issue Nov 12, 2024 · 6 comments
Assignees
Labels
question For any kind of question, whether about usage, contributing or the project in general

Comments

@gythaogg
Copy link
Contributor

The autocomplete offers a Create option when the input in the autocomplete field does not yield any matching results.

I think it should not be possible (and functionally at the moment, it is not possible) to create a new entity in the Subj/Obj field at the time of creating or editing a relation (this is up for debate).

But if we decide to offer this feature then it should work (related to #1363).

@gythaogg gythaogg added the question For any kind of question, whether about usage, contributing or the project in general label Nov 12, 2024
@gythaogg gythaogg changed the title question (relations): Should there be a create option in the subj/obj autocomplete? question(relations): should there be a create option in the subj/obj autocomplete? Nov 12, 2024
@b1rger
Copy link
Contributor

b1rger commented Nov 12, 2024

We use this feature in a project. The users paste links to rdf data from other sources and create those entities while creating realtions.
Can you explain what happens when you use the Create option and what you would expect to happen?

@gythaogg
Copy link
Contributor Author

Oh okay - perhaps we are talking about two different scenarios - correct me if I am wrong, but your usecase looks similar to what happens in the "Enrich" feature.
When I type in a value in the field and it is completely unknown to the autocomplete, then it offers a Create in the dropdown
image
When I select this I get this error:
image
After this I am not able to enter anything in this field.

This error is an improvement compared to #1363 but I was wondering why we need to allow this at all. I am of course wrong if the new objects created via data from other sources also use the same Create option.

@b1rger
Copy link
Contributor

b1rger commented Nov 12, 2024

Thats what I'm talking about.

I paste a link, then click the Create option:
Screenshot-2024-11-12-131238

it then creates the instance in the background and automatically selects it:
Screenshot-2024-11-12-131254

@gythaogg
Copy link
Contributor Author

gythaogg commented Nov 12, 2024

Oh that's cool! I guess you have handlers to import the RDF into the entity. In case it is not possible to create the entity in the background (if the user enters QQQQQ, instead of a valid URL, for example), I am not given any information that this is going to fail. It simply puts "Create QQQQ" in the Subj/Obj field
image

And then when I click on Submit I get the error - after which my only option is to close and reopen the dialog.

Also, how do you choose the content type of the entity you create in the background (in case this relation supports subject/object of multiple types) - is it based on the attributes of the RDF data?

@b1rger
Copy link
Contributor

b1rger commented Nov 12, 2024

Oh that's cool! I guess you have handlers to import the RDF into the entity. In case it is not possible to create the entity in the background (if the user enters QQQQQ, instead of a valid URL, for example), I am not given any information that this is going to fail. It simply puts "Create QQQQ" in the Subj/Obj field

ah, yeah, there should be some information about the creation failing. thats a bug.

Also, how do you choose the content type of the entity you create in the background (in case this relation supports subject/object of multiple types) - is it based on the attributes of the RDF data?

Hah, this is a long discussion I've had with @sennierer last week and a couple of times before! It would be ideal if it was possible to create the instance based only on the data from the URI and decide which model it should be. But currently we have to pass the target model to the method that does the import. And in the relation form you (should) see the Create ... option only if there is only one possible entity target type (which is the case for all the relations forms in the entity edit view)

@gythaogg
Copy link
Contributor Author

So I'll create a separate issue for the background object creation failing and close this one. Thanks for the answers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question For any kind of question, whether about usage, contributing or the project in general
Projects
None yet
Development

No branches or pull requests

2 participants