Skip to content

Updated vocab load curl command to v8.5.0 compliant#1695

Merged
joelit merged 2 commits intomainfrom
updated-test-vocab-initialization
Oct 9, 2024
Merged

Updated vocab load curl command to v8.5.0 compliant#1695
joelit merged 2 commits intomainfrom
updated-test-vocab-initialization

Conversation

@joelit
Copy link
Contributor

@joelit joelit commented Oct 9, 2024

Reasons for creating this PR

The cUrl command in tests/init_containers does not work with the a newer curl verision and needed a re-write. The previous command was working on curl 7.81.0. This one is tested with curl 8.5.0.

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 9, 2024

@osma
Copy link
Member

osma commented Oct 9, 2024

The proposed curl command didn't work very well on curl 7.x, because it created graphs like this:

=================================================================================
| <http://www.skosmos.skos/cbd/cbd.ttl>                                         |
| <http://www.skosmos.skos/changes/changes.ttl>                                 |
| <http://www.skosmos.skos/collation/collation.ttl>                             |
| <http://www.skosmos.skos/conceptPropertyLabels/conceptPropertyLabels.ttl>     |
| <http://www.skosmos.skos/cycle/cycle.ttl>                                     |
| <http://www.skosmos.skos/date/date.ttl>                                       |
| <http://www.skosmos.skos/default_graph/default_graph.ttl>                     |
| <http://www.skosmos.skos/dupgroup/dupgroup.ttl>                               |
| <http://www.skosmos.skos/dup/dup.ttl>                                         |
| <http://www.skosmos.skos/groups/groups.ttl>                                   |
| <http://www.skosmos.skos/http304/http304.ttl>                                 |
| <http://www.skosmos.skos/mapping/mapping.ttl>                                 |
| <http://www.skosmos.skos/multiple-schemes/multiple-schemes.ttl>               |
| <http://www.skosmos.skos/myns-ontology/myns-ontology.ttl>                     |
| <http://www.skosmos.skos/nolang/nolang.ttl>                                   |
| <http://www.skosmos.skos/prefix/prefix.ttl>                                   |
| <http://www.skosmos.skos/subtag/subtag.ttl>                                   |
| <http://www.skosmos.skos/sub/sub.ttl>                                         |
| <http://www.skosmos.skos/test-551-A/test-551-A.ttl>                           |
| <http://www.skosmos.skos/test-concept-schemes/test-concept-schemes.ttl>       |
| <http://www.skosmos.skos/test-marc/test-marc.ttl>                             |
| <http://www.skosmos.skos/test-notation-sort/test-notation-sort.ttl>           |
| <http://www.skosmos.skos/test-qualified-broader/test-qualified-broader.ttl>   |
| <http://www.skosmos.skos/test-qualified-notation/test-qualified-notation.ttl> |
| <http://www.skosmos.skos/test/test.ttl>                                       |
| <http://www.skosmos.skos/xl/xl.ttl>                                           |
| <http://www.skosmos.skos/yso/yso.ttl>                                         |
---------------------------------------------------------------------------------

It appears that curl 7.x is appending the filename given with -T to the URL, so it becomes part of the graph name:

* Connected to localhost (127.0.0.1) port 9030 (#0)
> PUT /skosmos/data?graph=http://www.skosmos.skos/test-marc/test-marc.ttl HTTP/1.1
> Host: localhost:9030
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Type: text/turtle
> Content-Length: 1412
> Expect: 100-continue

I modified the command so it avoids using -T and instead uses another method for uploading. Now the graph names are correct:

------------------------------------------------------
| g                                                  |
======================================================
| <http://www.skosmos.skos/cbd/>                     |
| <http://www.skosmos.skos/changes/>                 |
| <http://www.skosmos.skos/collation/>               |
| <http://www.skosmos.skos/conceptPropertyLabels/>   |
| <http://www.skosmos.skos/cycle/>                   |
| <http://www.skosmos.skos/date/>                    |
| <http://www.skosmos.skos/default_graph/>           |
| <http://www.skosmos.skos/dupgroup/>                |
| <http://www.skosmos.skos/dup/>                     |
| <http://www.skosmos.skos/groups/>                  |
| <http://www.skosmos.skos/http304/>                 |
| <http://www.skosmos.skos/mapping/>                 |
| <http://www.skosmos.skos/multiple-schemes/>        |
| <http://www.skosmos.skos/myns-ontology/>           |
| <http://www.skosmos.skos/nolang/>                  |
| <http://www.skosmos.skos/prefix/>                  |
| <http://www.skosmos.skos/subtag/>                  |
| <http://www.skosmos.skos/sub/>                     |
| <http://www.skosmos.skos/test-551-A/>              |
| <http://www.skosmos.skos/test-concept-schemes/>    |
| <http://www.skosmos.skos/test-marc/>               |
| <http://www.skosmos.skos/test-notation-sort/>      |
| <http://www.skosmos.skos/test-qualified-broader/>  |
| <http://www.skosmos.skos/test-qualified-notation/> |
| <http://www.skosmos.skos/test/>                    |
| <http://www.skosmos.skos/xl/>                      |
| <http://www.skosmos.skos/yso/>                     |
------------------------------------------------------

@joelit can you check whether the new command still works with curl 8.x?

@joelit
Copy link
Contributor Author

joelit commented Oct 9, 2024

I can confirm it works now with curl 8.x, too.

@joelit joelit self-assigned this Oct 9, 2024
@joelit joelit added this to the 3.0 milestone Oct 9, 2024
@joelit joelit merged commit 0fe6ee1 into main Oct 9, 2024
@joelit joelit deleted the updated-test-vocab-initialization branch October 9, 2024 11:08
@osma osma modified the milestones: 3.x, 3.0 Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants