Commits

Stefano Costa  committed 6314fee

First step in making the script generic

  • Participants
  • Parent commits ca19e68

Comments (0)

Files changed (1)

File arsw-hayes.py

     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:skos="http://www.w3.org/2004/02/skos/core#" >
-  <rdf:Description rdf:about="http://archvocab.net/fineware/arsw-hayes/arsw-hayes_scheme">
+  <rdf:Description rdf:about="http://archvocab.net/fineware/{slug}/{slug}_scheme">
     <rdfs:isDefinedBy>Hayes, John W. 1972. Late Roman Pottery - Hayes, John W. 1980. A supplement to Late Roman Pottery.</rdfs:isDefinedBy>
     <skos:prefLabel xml:lang="en">Hayes African Red Slip Ware</skos:prefLabel>
     <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/>
     input_data = open(input_file).read().splitlines()
     output = open(output_file, 'wb')
 
-    output.write(bytes(HEADER, 'utf-8'))
+    data = {'slug': input_file.replace('.txt','')}
+
+    output.write(bytes(HEADER.format(**data), 'utf-8'))
 
     for i in input_data:
         if ':' in i: