Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kg-construct/rml-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 19067eeb46d6315156abb4825195811bba31911d
Choose a base ref
..
head repository: kg-construct/rml-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1b30185d00910c1c8df05da2a6b00bba91d126eb
Choose a head ref
Showing with 1,715 additions and 1,981 deletions.
  1. +135 −78 test-cases/make-metadata.py
  2. +1,256 −1,579 test-cases/manifest.ttl
  3. +324 −324 test-cases/metadata.csv
213 changes: 135 additions & 78 deletions test-cases/make-metadata.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ def get_title_description(testcase: str):
reader = csv.reader(csvfile)
for row in reader:
if row[0] == testcase:
print(row[1], row[2])
return row[1], row[2]

def main(spec: str):
@@ -22,8 +21,9 @@ def main(spec: str):
'output_format3', 'input1', 'input2', 'input3',
'output1', 'output2', 'output3', 'error'])
for testcase in glob.glob('RML*'):
print(testcase)
title, description = get_title_description(testcase)
title = '"' + title + '"'
description = '"' + description + '"'
error = 'false'
input1 = ''
input2 = ''
@@ -39,45 +39,143 @@ def main(spec: str):
output_format3 = ''

# Input file
if os.path.exists(os.path.join(testcase, 'Friends.json')):
input1 = 'Friends.json'
if os.path.exists(os.path.join(testcase, 'student.json')):
input1 = 'student.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'Friends-UTF16.json')):
input1 = 'Friends-UTF16.json'
elif os.path.exists(os.path.join(testcase, 'student_sport.json')):
if testcase == 'RMLTC0009a-JSON' or testcase == 'RMLTC0009b-JSON':
input3 = 'student_sport.json'
input_format3 = 'application/json'
else:
input1 = 'student_sport.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'sport.json')):
input2 = 'sport.json'
input_format2 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'ious.json')):
input1 = 'ious.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'Friends.json.gz')):
input1 = 'Friends.json.gz'
input_format1 = 'application/gzip+json'
elif os.path.exists(os.path.join(testcase, 'Friends.json.zip')):
input1 = 'Friends.json.zip'
input_format1 = 'application/gzip+json'
elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.xz')):
input1 = 'Friends.json.tar.xz'
input_format1 = 'application/tarxz+json'
elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.gz')):
input1 = 'Friends.json.tar.gz'
input_format1 = 'application/targz+json'
elif os.path.exists(os.path.join(testcase, 'Friends-NULL.csv')):
input1 = 'Friends-NULL.csv'
elif os.path.exists(os.path.join(testcase, 'country_info.json')):
input1 = 'country_info.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'persons.json')):
if testcase == 'RMLTC0012b-JSON':
input2 = 'persons.json'
input_format2 = 'application/json'
else:
input1 = 'persons.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'country_en.json')):
input1 = 'country_en.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'country_es.json')):
input1 = 'country_es.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'data.json')):
input1 = 'data.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'lives.json')):
input1 = 'lives.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'student.xml')):
input1 = 'student.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'student_sport.xml')):
if testcase == 'RMLTC0009a-XML' or testcase == 'RMLTC0009b-XML':
input3 = 'student_sport.xml'
input_format3 = 'text/xml'
else:
input1 = 'student_sport.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'sport.xml')):
input2 = 'sport.xml'
input_format2 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'ious.xml')):
input1 = 'ious.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'country_info.xml')):
input1 = 'country_info.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'persons.xml')):
if testcase == 'RMLTC0012b-XML':
input2 = 'persons.xml'
input_format2 = 'text/xml'
else:
input1 = 'persons.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'country_en.xml')):
input1 = 'country_en.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'country_es.xml')):
input1 = 'country_es.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'data.xml')):
input1 = 'data.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'lives.xml')):
input1 = 'lives.xml'
input_format1 = 'text/xml'
elif os.path.exists(os.path.join(testcase, 'student.csv')):
input1 = 'student.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'Friends-NULL2.csv')):
input1 = 'Friends-NULL2.csv'
elif os.path.exists(os.path.join(testcase, 'student_sport.csv')):
if testcase == 'RMLTC0009a-CSV' or testcase == 'RMLTC0009b-CSV':
input3 = 'student_sport.csv'
input_format3 = 'text/csv'
else:
input1 = 'student_sport.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'sport.csv')):
input2 = 'sport.csv'
input_format2 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'ious.csv')):
input1 = 'ious.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'Friends.nt')):
input1 = 'Friends.nt'
input_format1 = 'application/n-triples'
elif os.path.exists(os.path.join(testcase, 'Friends.csv')):
input1 = 'Friends.csv'
elif os.path.exists(os.path.join(testcase, 'country_info.csv')):
input1 = 'country_info.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'Friends.json')):
input1 = 'Friends.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'Friends.xml')):
input1 = 'Friends.xml'
input_format1 = 'text/xml'
else:
input1 = f'http://w3id.org/rml/resources/rml-io/{testcase}/Friends.json'
input_format1 = 'application/json'
elif os.path.exists(os.path.join(testcase, 'persons.csv')):
if testcase == 'RMLTC0012b-CSV':
input2 = 'persons.csv'
input_format2 = 'text/csv'
else:
input1 = 'persons.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'country_en.csv')):
input1 = 'country_en.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'country_es.csv')):
input1 = 'country_es.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'data.csv')):
input1 = 'data.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'lives.csv')):
input1 = 'lives.csv'
input_format1 = 'text/csv'
elif os.path.exists(os.path.join(testcase, 'resource.sql')):
input1 = 'resource.sql'
if 'MySQL' in testcase:
input_format1 = 'application/sql+mysql'
elif 'PostgreSQL' in testcase:
input_format1 = 'application/sql+postgresql'
elif 'SQLServer' in testcase:
input_format1 = 'application/sql+sqlserver'
elif 'MariaDB' in testcase:
input_format1 = 'application/sql+mariadb'
elif 'SQLite' in testcase:
input_format1 = 'application/sql+sqlite'
else:
input_format1 = 'application/sql'
elif os.path.exists(os.path.join(testcase, 'resource.ttl')):
input1 = 'resource.ttl'
input_format1 = 'text/turtle'
elif os.path.exists(os.path.join(testcase, 'resource1.ttl')):
input1 = 'resource1.ttl'
input_format1 = 'text/turtle'
elif os.path.exists(os.path.join(testcase, 'resource2.ttl')):
input2 = 'resource2.ttl'
input_format2 = 'text/turtle'

# Mapping file
if os.path.exists(os.path.join(testcase, 'mapping.ttl')):
@@ -86,53 +184,12 @@ def main(spec: str):
raise ValueError('Mapping file missing!')

# Output files
if os.path.exists(os.path.join(testcase, 'default.nq')):
output1 = 'default.nq'
output_format1 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'output.nq')):
if os.path.exists(os.path.join(testcase, 'output.nq')):
output1 = 'output.nq'
output_format1 = 'application/n-quads'
else:
error = 'true';

if os.path.exists(os.path.join(testcase, 'dump1.nq')):
output2 = 'dump1.nq'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.nt')):
output2 = 'dump1.nt'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.n3')):
output2 = 'dump1.n3'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.jsonld')):
output2 = 'dump1.jsonld'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.rdfjson')):
output2 = 'dump1.rdfjson'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.rdfxml')):
output2 = 'dump1.rdfxml'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.ttl')):
output2 = 'dump1.ttl'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.nq.gz')):
output2 = 'dump1.nq.gz'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.nq.zip')):
output2 = 'dump1.nq.zip'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.xz')):
output2 = 'dump1.nq.tar.xz'
output_format2 = 'application/n-quads'
elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.gz')):
output2 = 'dump1.nq.tar.gz'
output_format2 = 'application/n-quads'

if os.path.exists(os.path.join(testcase, 'dump2.nq')):
output3 = 'dump2.nq'
output_format3 = 'application/n-quads'

writer.writerow([testcase, title, description, spec, mapping_file,
input_format1, input_format2, input_format3,
output_format1, output_format2, output_format3,
Loading