mirror of
https://github.com/ISEAL-Community/iseal-core.git
synced 2025-05-09 14:46:03 +02:00
Don't use ALL CAPS in CSVs
Convert to lower case and update scripts. Closes #13
This commit is contained in:
@ -60,7 +60,7 @@ def make_rdf(file, ns):
|
||||
|
||||
## create properties
|
||||
elementURI = URIRef(NS + dspace.replace(".", "-").lower())
|
||||
if prop_type == "CONTROLLED VALUE": ## object property
|
||||
if prop_type == "controlled value": ## object property
|
||||
g.add((elementURI, SKOS.prefLabel, Literal(element_name)))
|
||||
g.add((elementURI, RDF.type, OWL.ObjectProperty))
|
||||
g.add((elementURI, RDFS.domain, conceptUri))
|
||||
@ -132,7 +132,7 @@ def make_rdf(file, ns):
|
||||
continue
|
||||
|
||||
## cardinality
|
||||
if cardinality == "MULTI SELECT FROM CONTROL LIST":
|
||||
if cardinality == "multi select from control list":
|
||||
br = BNode()
|
||||
g.add((br, RDF.type, OWL.Restriction))
|
||||
g.add((br, OWL.onProperty, elementURI))
|
||||
@ -180,17 +180,17 @@ def make_rdf(file, ns):
|
||||
)
|
||||
)
|
||||
range = None
|
||||
if prop_type == "DATE":
|
||||
if prop_type == "date":
|
||||
g.add((elementURI, RDFS.range, XSD.date))
|
||||
range = XSD.date
|
||||
elif prop_type == "NUMERIC VALUE":
|
||||
elif prop_type == "numeric value":
|
||||
g.add((elementURI, RDFS.range, XSD.float))
|
||||
range = XSD.float
|
||||
else:
|
||||
g.add((elementURI, RDFS.range, XSD.string))
|
||||
range = XSD.string
|
||||
##cardinality
|
||||
if cardinality == "REPEAT VALUES":
|
||||
if cardinality == "repeat values":
|
||||
br = BNode()
|
||||
g.add((br, RDF.type, OWL.Restriction))
|
||||
g.add((br, OWL.onProperty, elementURI))
|
||||
|
@ -113,7 +113,7 @@ def parseSchema(schema_df):
|
||||
required = False
|
||||
|
||||
# Combine element type and options into a "policy" of sorts and convert
|
||||
# them to sentence case because they are ALL CAPS in the Excel. We don't
|
||||
# them to sentence case because they are lowercase in the CSV. We don't
|
||||
# need to do any checks because these fields should always exist.
|
||||
policy = f'{row["element type"].capitalize()}. {row["element options"].capitalize()}.'
|
||||
|
||||
|
Reference in New Issue
Block a user