@@ -608,6 +608,7 @@ def process(name, args):
608
608
#check a subdir called outbase exists - create if missing
609
609
if not os .path .exists (os .path .join ( outdir ,outbase ) ):
610
610
os .makedirs (os .path .join ( outdir ,outbase ))
611
+ rel_file_base = outbase
611
612
output_file_base = os .path .join ( outdir , outbase ,outbase )
612
613
# Process known resources and intentions from the profile catalog list, before
613
614
owl = output_file_base + ".ttl"
@@ -656,14 +657,14 @@ def process(name, args):
656
657
for fmt , mime in formats .items ():
657
658
dedupgraph .serialize (destination = output_file_base + "." + fmt ,
658
659
format = 'json-ld' if fmt == 'jsonld' else fmt )
659
- curprofile .addResource (ontid , output_file_base + "." + fmt , "Normalised OWL with imports" ,
660
+ curprofile .addResource (ontid , rel_file_base + "." + fmt , "Normalised OWL with imports" ,
660
661
desc = "This is an OWL file with imports for ontologies containing all object definitions, but with only statements not present in imports" ,
661
662
role = PROFROLE .vocabulary ,
662
663
conformsTo = OWL ,
663
664
fmt = mime )
664
665
if args .all or args .flat :
665
666
maximal_ont .serialize (destination = output_file_base + "_flat." + fmt , format = 'json-ld' if fmt == 'jsonld' else fmt )
666
- curprofile .addResource (ontid , output_file_base + "_flat." + fmt ,
667
+ curprofile .addResource (ontid , rel_file_base + "_flat." + fmt ,
667
668
"OWL with definition details from imports" ,
668
669
role = PROFROLE .vocabulary ,
669
670
conformsTo = OWL ,
@@ -675,7 +676,7 @@ def process(name, args):
675
676
if args .all or args .json :
676
677
with open (output_file_base + "_context_flat.jsonld" , "w" ) as outfile :
677
678
json .dump (make_context (ontid , maximal_ont , fullclosure , used_namespaces , args .q , profiles = profiles , flat = True ), outfile , indent = 4 )
678
- curprofile .addResource (ontid , output_file_base + "_context_flat.jsonld" ,
679
+ curprofile .addResource (ontid , rel_file_base + "_context_flat.jsonld" ,
679
680
"Flattened JSON-LD context" ,
680
681
role = PROFROLE .contextflat ,
681
682
conformsTo = JSONLD_URI , fmt = 'application/ld+json' )
@@ -684,7 +685,7 @@ def process(name, args):
684
685
json .dump (make_context (ontid , dedupgraph , fullclosure , used_namespaces , args .q , profiles = profiles , flat = False ),
685
686
outfile ,
686
687
indent = 4 )
687
- curprofile .addResource (ontid , output_file_base + "_context.jsonld" , "JSON-LD Context - local file link" ,
688
+ curprofile .addResource (ontid , rel_file_base + "_context.jsonld" , "JSON-LD Context - local file link" ,
688
689
role = PROFROLE .contextlocal ,
689
690
conformsTo = JSONLD_URI ,
690
691
fmt = 'application/ld+json' )
@@ -695,7 +696,7 @@ def process(name, args):
695
696
if args .all or args .json :
696
697
with open (output_file_base + ".json" , "w" ) as outfile :
697
698
json .dump (make_schema (ontid , dedupgraph , args .q , frames ), outfile , indent = 4 )
698
- curprofile .addResource (ontid , output_file_base + ".json" , "JSON Schema" , role = PROFROLE .schema ,
699
+ curprofile .addResource (ontid , rel_file_base + ".json" , "JSON Schema" , role = PROFROLE .schema ,
699
700
conformsTo = JSONSCHEMA_URI ,
700
701
fmt = 'application/json' )
701
702
@@ -704,7 +705,7 @@ def process(name, args):
704
705
html = pylode .MakeDocco (
705
706
input_graph = ont , outputformat = "html" , profile = "ontdoc" , exclude_css = css_found ).document ()
706
707
htmlfile .write (html )
707
- curprofile .addResource (ontid , output_file_base + "_source.html" ,
708
+ curprofile .addResource (ontid , rel_file_base + "_source.html" ,
708
709
"Profile description as HTML" , role = PROFROLE .profile ,
709
710
conformsTo = PROF ,
710
711
desc = "Original source OWL file as HTML - for comparison and review purposes" ,
@@ -731,7 +732,7 @@ def process(name, args):
731
732
subs = {'https://astrea.linkeddata.es/shapes' : ontid + "_shapes" ,
732
733
'http://schema.org/' : 'https://schema.org/' })
733
734
file .write (shacl )
734
- curprofile .addResource (ontid , output_file_base + "_flat_shacl.ttl" ,
735
+ curprofile .addResource (ontid , rel_file_base + "_flat_shacl.ttl" ,
735
736
"SHACL constraints for profile" ,
736
737
desc = "SHACL validation constraints for all declarations relevant to profile including imports" ,
737
738
role = PROFROLE .validation ,
@@ -742,7 +743,7 @@ def process(name, args):
742
743
subs = {'https://astrea.linkeddata.es/shapes' : ontid + "_shapes" ,
743
744
'http://schema.org/' : 'https://schema.org/' })
744
745
file .write (shacl )
745
- curprofile .addResource (ontid , output_file_base + "_shacl.ttl" ,
746
+ curprofile .addResource (ontid , rel_file_base + "_shacl.ttl" ,
746
747
"SHACL for minimal profile" ,
747
748
desc = "SHACL validation constraints for profile specific declarations" ,
748
749
role = PROFROLE .validation ,
@@ -751,7 +752,7 @@ def process(name, args):
751
752
752
753
if args .all or args .html_owl :
753
754
docgraph = maximal_ont
754
- curprofile .addResource (ontid , output_file_base + ".html" ,
755
+ curprofile .addResource (ontid , rel_file_base + ".html" ,
755
756
"OWL documentation as HTML" ,
756
757
desc = "Based on the OWL flat view of the profile, a HTML rendering of key elements of the model." ,
757
758
role = PROFROLE .profile ,
@@ -764,7 +765,7 @@ def process(name, args):
764
765
765
766
# serialise current profile last - so it captures all formats generated
766
767
if args .all or args .html_prof :
767
- curprofile .addResource (ontid , output_file_base + "_prof.html" ,
768
+ curprofile .addResource (ontid , rel_file_base + "_prof.html" ,
768
769
"Profile description as HTML" , role = PROFROLE .profile ,
769
770
conformsTo = PROF ,
770
771
desc = "Overview of profile and available descriptive and implementation support resources" ,
0 commit comments