Skip to content

request 403 and filename invalid, Script execution failed to build a complete dataset #515

@hug-fate

Description

@hug-fate

branch: develop

I opened the deifinitions project with PyCharm Community Edition 2020.2.3 and created the virtual environment. When I executed the script
python datasets.py -l
with reference to the documentation, the following error occurred:

Using cached cache\http%3A%2F%2Fid.loc.gov%2Fontologies%2Fbibframe%2F.ttl for http://id.loc.gov/ontologies/bibframe/
Writing: F:\programs\other16\definitions\build\dataset\vocab.jsonld
Writing: F:\programs\other16\definitions\build\vocab.jsonld
Writing: F:\programs\other16\definitions\build\vocab\display.jsonld
Dataset: apps
Writing dataset lines to file: F:\programs\other16\definitions\build\apps.json.lines
Writing: F:\programs\other16\definitions\build\https:\libris.kb.se\.jsonld
python-BaseException
Traceback (most recent call last):
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 102, in _run
    self._compile_datasets(names)
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 141, in _compile_datasets
    result = build()
  File "F:\programs\other16\definitions\syscore.py", line 140, in apps
    compiler.write({'@graph': descriptions}, slug)
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 267, in write
    outfile.parent.mkdir(parents=True, exist_ok=True)
  File "D:\Programs\Anaconda3\envs\libris\lib\pathlib.py", line 1288, in mkdir
    self._accessor.mkdir(self, mode)
OSError: [WinError 123] [The filename, directory name, or volume label syntax is incorrect](https://superuser.com/questions/1137764/windows-10-cmd-exe-the-filename-directory-name-or-volume-label-syntax-is-inco). : 'F:\\programs\\other16\\definitions\\build\\https:\\libris.kb.se'

Process finished with exit code 1

After I add the following code
name = self.get_cached_path(name + '.ttl')
the new error:

Writing dataset lines to file: F:\programs\other16\definitions\build\countries.json.lines
Caching http://id.loc.gov/vocabulary/countries as cache\http%3A%2F%2Fid.loc.gov%2Fvocabulary%2Fcountries.ttl
Failed on remote path http://id.loc.gov/vocabulary/countries
Traceback (most recent call last):
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 102, in _run
    self._compile_datasets(names)
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 141, in _compile_datasets
    result = build()
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 402, in dataset_handler
    graph = compiler.construct(
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 385, in construct
    return _construct(self, sources, query)
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 521, in _construct
    graph += compiler.cached_rdf(source, sourcedfn.get('query'), sourcedfn.get('graph'))
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 352, in cached_rdf
    raise e
  File "F:\programs\other16\definitions\lxltools\datacompiler.py", line 349, in cached_rdf
    source.parse(remotepath, format=format)
  File "D:\Programs\Anaconda3\envs\libris\lib\site-packages\rdflib\graph.py", line 1234, in parse
    source = create_input_source(
  File "D:\Programs\Anaconda3\envs\libris\lib\site-packages\rdflib\parser.py", line 326, in create_input_source
    ) = _create_input_source_from_location(
  File "D:\Programs\Anaconda3\envs\libris\lib\site-packages\rdflib\parser.py", line 375, in _create_input_source_from_location
    input_source = URLInputSource(absolute_location, format)
  File "D:\Programs\Anaconda3\envs\libris\lib\site-packages\rdflib\parser.py", line 218, in __init__
    file = _urlopen(req)
  File "D:\Programs\Anaconda3\envs\libris\lib\site-packages\rdflib\parser.py", line 206, in _urlopen
    return urlopen(req)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 563, in error
    result = self._call_chain(*args)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "D:\Programs\Anaconda3\envs\libris\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions