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

Q:Is there a way to get better error messages from the API? #257

Closed
louis-vinchon opened this issue Mar 8, 2022 · 4 comments
Closed

Q:Is there a way to get better error messages from the API? #257

louis-vinchon opened this issue Mar 8, 2022 · 4 comments

Comments

@louis-vinchon
Copy link

louis-vinchon commented Mar 8, 2022

The Question
Here's a sample error message from the API:

{
    "data": {
      "timestamp": 1646750105763,
      "status": 406,
      "error": "Not Acceptable",
      "path": "/test"
    }
}

The request was obvisouly rejected. My question is: what is not accpetable in my request?

I can only assume that it's a SHACL validation issue, but the API provides 0 details.

@janslifka
Copy link
Contributor

Hello @K41eb,

406 Not Acceptable is a response status defined in HTTP Protocol. It indicates that the server cannot produce a response that would match Accept headers in the HTTP request.

Could you provide the HTTP request you're trying to make?

@louis-vinchon
Copy link
Author

I was trying to perform the request described in your documentqtion https://fairdatapoint.readthedocs.io/en/latest/usage/api-usage.html

curl -H "Authorization: Bearer efIobn394nvJJFJ30..." \
    -H "Content-Type: text/turtle" \
    -d @metadata.ttl https://fdp.example.com/dataset

but i had an extra header. This particular issue is fixed now, however I now get the following error:

    data: {
      timestamp: 1646830055192,
      status: 400,
      error: 'Bad Request',
      message: 'Validation failed (no rdf:type was provided)'
    }

@janslifka
Copy link
Contributor

What exactly is in the metadata.ttl file you're sending to FDP? I've just tried that with the one provided in the documentation page where I only change URI in dct:isPartOf to be an existing catalog and it worked.

@louis-vinchon
Copy link
Author

louis-vinchon commented Mar 9, 2022

I was trying things with my own SHACL shapes and turtle files but that was probably not the best approach, sorry for wasting your time.

I am now trying to create a catalog before the dataset, sometimes I get the SHACL validation errors (I can work with these, all is good on that front), and sometimes I get messages such as Not parent uri for the following ttl:

@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<> a dcat:Catalog ;
  dct:title "test" ;
  dct:hasVersion "1.0" ;
  dct:publisher [ a foaf:Agent ; foaf:name "Example User" ] .

I'm having trouble idnetifying what the issue is. And the DCAT documentation isn't helping either.
https://www.w3.org/TR/vocab-dcat-2/

Would you mind sharing your valid catalog and dataset files and api calls?

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

No branches or pull requests

2 participants