andrecastro0o / ontology2smw

automating an RDF ontology import into Semantic Mediawiki
GNU General Public License v3.0
16 stars 5 forks source link

script should be able to run without wikidetails.yml #16

Closed andrecastro0o closed 3 years ago

andrecastro0o commented 3 years ago
 andre@hammerhead:~/Documents/TIB/projects/confiDent/code/ontology2smw$ ontology2smw -f ttl -o aeon/aeon.ttl 
Traceback (most recent call last):
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/bin/ontology2smw", line 33, in <module>
    sys.exit(load_entry_point('ontology2smw==0.0.1', 'console_scripts', 'ontology2smw')())
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/lib/python3.7/site-packages/ontology2smw-0.0.1-py3.7.egg/ontology2smw/__main__.py", line 26, in main
    from ontology2smw.functions import sparql2smwpage
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/lib/python3.7/site-packages/ontology2smw-0.0.1-py3.7.egg/ontology2smw/functions.py", line 6, in <module>
    from ontology2smw.classes import Query, SMWCategoryORProp, SMWImportOverview
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/lib/python3.7/site-packages/ontology2smw-0.0.1-py3.7.egg/ontology2smw/classes.py", line 6, in <module>
    from mediawikitools.wiki import actions as mwactions
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/lib/python3.7/site-packages/mediawikitools/__init__.py", line 14, in <module>
    wikidetails = file_utils.yaml_get_source('wikidetails.yml')
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/lib/python3.7/site-packages/mediawikitools/utilities/file_utils.py", line 21, in yaml_get_source
    yamldict = yaml2dict(path_file)
  File "/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/venv/lib/python3.7/site-packages/mediawikitools/utilities/file_utils.py", line 7, in yaml2dict
    with open(path, 'r') as yaml_f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/andre/Documents/TIB/projects/confiDent/code/ontology2smw/wikidetails.yml'
andrecastro0o commented 3 years ago

The solution is to have the wikidetails.yml always there. by default they are the ones from the VM. The application runs even if the VM is down, as long as argument --write is not used