Skip to content

Commit

Permalink
update unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
MBueschelberger committed Dec 18, 2024
1 parent 6d2b2ab commit d166427
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{
"iri": "https://w3id.org/steel/ProcessOntology/TimeStamp",
"key": "Datum",
"suffix": "Time2",
"value_location": "AD6",
"worksheet": "Protokoll"
},
Expand Down Expand Up @@ -119,7 +120,7 @@
{
"iri": "https://w3id.org/steel/ProcessOntology/TestTime",
"key": "Zeit",
"suffix": "Time",
"suffix": "Time1",
"time_series_start": "A15",
"unit_location": "A14",
"worksheet": "Messdaten"
Expand Down
311 changes: 106 additions & 205 deletions tests/abox/xls_pipeline_test/output/output_pipeline_suffix.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -2,257 +2,158 @@
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix fileid: <https://www.example.org/> .
@prefix foaf: <http://xmlns.com/foaf/spec/> .
@prefix ns1: <http://www.w3.org/ns/prov#> .
@prefix foaf1: <http://xmlns.com/foaf/spec/> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

fileid:TensileTestExperiment a ns1:Activity ;
ns1:generated fileid:AbsoluteCrossheadTravel,
fileid:Extension,
fileid:Remark,
fileid:StandardForce,
fileid:TimeStamp,
fileid:dataset ;
ns1:hadPlan fileid:TestStandard ;
ns1:used fileid:DisplacementTransducer,
fileid:ForceMeasuringDevice,
fileid:TensileTestSpecimen,
fileid:TensileTestingMachine,
fileid:TestingFacility ;
ns1:wasAssociatedWith fileid:Tester ;
ns1:wasInfluencedBy fileid:ExperimentPreparation .
fileid:dataset a dcat:Dataset ;
dcterms:hasPart fileid:tableGroup ;
dcat:distribution [ a dcat:Distribution ;
dcat:accessURL "https://www.example.org/download"^^xsd:anyURI ;
dcat:mediaType "https://www.iana.org/assignments/media-types/application/vnd.ms-excel"^^xsd:anyURI ] .

fileid:TestingStandard a ns1:Plan .
fileid:AbsoluteCrossheadTravel a <https://w3id.org/steel/ProcessOntology/AbsoluteCrossheadTravel> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI .

fileid:ExperimentPreparation a ns1:Activity ;
ns1:atLocation fileid:TestingLab ;
ns1:generated fileid:OriginalGaugeLength,
fileid:Preload,
fileid:TestingRate ;
ns1:wasAssociatedWith fileid:DisplacementTransducer,
fileid:ForceMeasuringDevice,
fileid:TensileTestSpecimen,
fileid:TensileTestingMachine,
fileid:Tester ;
ns1:wasInfluencedBy fileid:SamplePreparatation .
fileid:Extension a <https://w3id.org/steel/ProcessOntology/Extension> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI .

fileid:MachineData a <https://w3id.org/steel/ProcessOntology/MachineData> ;
rdfs:label "M_1"^^xsd:string .

fileid:ParallelLength a ns1:Entity ;
ns1:wasAttributedTo fileid:TensileTestSpecimen .
fileid:Material a <https://w3id.org/steel/ProcessOntology/Material>,
<https://w3id.org/steel/ProcessOntology/Werkstoff_1> ;
rdfs:label "Werkstoff_1"^^xsd:string .

fileid:OriginalGaugeLength a <https://w3id.org/steel/ProcessOntology/OriginalGaugeLength> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
qudt:value 15 .

fileid:PercentageElongation a <https://w3id.org/steel/ProcessOntology/PercentageElongation> ;
qudt:hasUnit "http://qudt.org/vocab/unit/FRACTION"^^xsd:anyURI .

fileid:Preload a ns1:Entity ;
ns1:wasAttributedTo fileid:TensileTestingMachine .

fileid:Project a ns1:Activity ;
ns1:generated fileid:ProjectName,
fileid:ProjectNumber ;
ns1:wasAssociatedWith fileid:TestingFacility .

fileid:ProjectName a ns1:Entity .
fileid:ProjectNumber a <https://w3id.org/steel/ProcessOntology/ProjectNumber> ;
rdfs:label "Projekt_1"^^xsd:string .

fileid:SampleIdentifier-2 a <https://w3id.org/steel/ProcessOntology/SampleIdentifier-2> ;
rdfs:label 123456 .

fileid:SamplePreparatation a ns1:Activity ;
ns1:generated fileid:ParallelLength,
fileid:SpecimenThickness,
fileid:SpecimenType,
fileid:SpecimenWidth ;
ns1:wasAssociatedWith fileid:Material,
fileid:TensileTestSpecimen ;
ns1:wasInfluencedBy fileid:Project .
fileid:SpecimenThickness a <https://w3id.org/steel/ProcessOntology/SpecimenThickness> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
qudt:value "1.5"^^xsd:float .

fileid:SpecimenType a <https://w3id.org/steel/ProcessOntology/SpecimenType> ;
rdfs:label "Fz 10x20"^^xsd:string .

fileid:Temperature a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/Temperature> ;
fileid:SpecimenWidth a <https://w3id.org/steel/ProcessOntology/SpecimenWidth> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
qudt:value "9.5"^^xsd:float .

fileid:StandardForce a <https://w3id.org/steel/ProcessOntology/StandardForce> ;
qudt:hasUnit "http://qudt.org/vocab/unit/KiloN"^^xsd:anyURI .

fileid:Temperature a <https://w3id.org/steel/ProcessOntology/Temperature> ;
qudt:hasUnit "http://qudt.org/vocab/unit/DEG_C"^^xsd:anyURI ;
qudt:value "25"^^xsd:integer ;
ns1:wasAttributedTo fileid:TestingLab .
qudt:value 25 .

fileid:Tester a <https://w3id.org/steel/ProcessOntology/Tester> ;
rdfs:label "Fe"^^xsd:string .

fileid:Time a <https://w3id.org/steel/ProcessOntology/TestTime> ;
fileid:TestingRate a <https://w3id.org/steel/ProcessOntology/TestingRate> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM-PER-SEC"^^xsd:anyURI ;
qudt:value "0.02"^^xsd:float .

fileid:Time1 a <https://w3id.org/steel/ProcessOntology/TestTime> ;
qudt:hasUnit "http://qudt.org/vocab/unit/SEC"^^xsd:anyURI .

fileid:Time2 a <https://w3id.org/steel/ProcessOntology/TimeStamp> ;
rdfs:label "2016-10-11 00:00:00"^^xsd:string .

fileid:WidthChange a <https://w3id.org/steel/ProcessOntology/WidthChange> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI .

fileid:dataset a dcat:Dataset,
ns1:Entity ;
dcterms:hasPart fileid:tableGroup ;
dcat:distribution [ a dcat:Distribution ;
dcat:accessURL "https://www.example.org/download/"^^xsd:anyURI ;
dcat:mediaType "https://www.iana.org/assignments/media-types/application/vnd.ms-excel"^^xsd:anyURI ] .

fileid:tableGroup a csvw:TableGroup ;
csvw:table [ a csvw:Table ;
rdfs:label "Metadata" ;
csvw:row [ a csvw:Row ;
qudt:quantity fileid:Temperature ;
csvw:titles "Prüftemperatur"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:SampleIdentifier-2 ;
csvw:titles "Probenkennung 2"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:SpecimenWidth ;
csvw:titles "Probenbreite b"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:Material ;
csvw:titles "Werkstoff"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:SpecimenThickness ;
csvw:titles "Probendicke a"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:Tester ;
csvw:titles "Prüfer"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:OriginalGaugeLength ;
csvw:titles "Messlänge Standardweg"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:MachineData ;
csvw:titles "Prüfmaschine"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:ProjectNumber ;
csvw:titles "Projekt"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:Time2 ;
csvw:titles "Datum"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:SpecimenType ;
csvw:titles "Probenform"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:TestingRate ;
csvw:titles "Prüfgeschwindigkeit"^^xsd:string ] ],
[ a csvw:Table ;
rdfs:label "Time series data" ;
csvw:tableSchema [ a csvw:Schema ;
csvw:column [ a csvw:Column ;
qudt:quantity fileid:StandardForce ;
csvw:titles "Standardkraft"^^xsd:string ;
foaf1:page [ a foaf1:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/column-2"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ],
[ a csvw:Column ;
qudt:quantity fileid:WidthChange ;
csvw:titles "Breitenänderung"^^xsd:string ;
foaf:page [ a foaf:Document ;
foaf1:page [ a foaf1:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/download/column-0"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/column-0"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ],
[ a csvw:Column ;
qudt:quantity fileid:TestTime ;
qudt:quantity fileid:Time1 ;
csvw:titles "Zeit"^^xsd:string ;
foaf:page [ a foaf:Document ;
foaf1:page [ a foaf1:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/download/column-5"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/column-5"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ],
[ a csvw:Column ;
qudt:quantity fileid:PercentageElongation ;
csvw:titles "Dehnung"^^xsd:string ;
foaf:page [ a foaf:Document ;
qudt:quantity fileid:Extension ;
csvw:titles "Standardweg"^^xsd:string ;
foaf1:page [ a foaf1:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/download/column-1"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/column-3"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ],
[ a csvw:Column ;
qudt:quantity fileid:StandardForce ;
csvw:titles "Standardkraft"^^xsd:string ;
foaf:page [ a foaf:Document ;
qudt:quantity fileid:PercentageElongation ;
csvw:titles "Dehnung"^^xsd:string ;
foaf1:page [ a foaf1:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/download/column-2"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/column-1"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ],
[ a csvw:Column ;
qudt:quantity fileid:AbsoluteCrossheadTravel ;
csvw:titles "Traversenweg absolut"^^xsd:string ;
foaf:page [ a foaf:Document ;
foaf1:page [ a foaf1:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/download/column-4"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ],
[ a csvw:Column ;
qudt:quantity fileid:Extension ;
csvw:titles "Standardweg"^^xsd:string ;
foaf:page [ a foaf:Document ;
dcterms:format "https://www.iana.org/assignments/media-types/application/json"^^xsd:anyURI ;
dcterms:identifier "https://www.example.org/download/column-3"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ] ] ],
[ a csvw:Table ;
rdfs:label "Metadata" ;
csvw:row [ a csvw:Row ;
csvw:describes fileid:Tester ;
csvw:titles "Prüfer"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:SampleIdentifier-2 ;
csvw:titles "Probenkennung 2"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:SpecimenThickness ;
csvw:titles "Probendicke a"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:OriginalGaugeLength ;
csvw:titles "Messlänge Standardweg"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:ProjectNumber ;
csvw:titles "Projekt"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:TestingRate ;
csvw:titles "Prüfgeschwindigkeit"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:SpecimenWidth ;
csvw:titles "Probenbreite b"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:Material ;
csvw:titles "Werkstoff"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:MachineData ;
csvw:titles "Prüfmaschine"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:TimeStamp ;
csvw:titles "Datum"^^xsd:string ],
[ a csvw:Row ;
qudt:quantity fileid:Temperature ;
csvw:titles "Prüftemperatur"^^xsd:string ],
[ a csvw:Row ;
csvw:describes fileid:SpecimenType ;
csvw:titles "Probenform"^^xsd:string ] ] .

fileid:AbsoluteCrossheadTravel a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/AbsoluteCrossheadTravel> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
ns1:wasDerivedFrom fileid:DisplacementTransducer .

fileid:Extension a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/Extension> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
ns1:wasDerivedFrom fileid:DisplacementTransducer .

fileid:Material a ns1:Agent,
<https://w3id.org/steel/ProcessOntology/Material>,
<https://w3id.org/steel/ProcessOntology/Werkstoff_1> ;
rdfs:label "Werkstoff_1"^^xsd:string .

fileid:OriginalGaugeLength a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/OriginalGaugeLength> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
qudt:value "15"^^xsd:integer ;
ns1:wasAttributedTo fileid:DisplacementTransducer .

fileid:ProjectNumber a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/ProjectNumber> ;
rdfs:label "Projekt_1"^^xsd:string .

fileid:SpecimenThickness a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/SpecimenThickness> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
qudt:value "1.5"^^xsd:float ;
ns1:wasAttributedTo fileid:TensileTestSpecimen .

fileid:SpecimenType a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/SpecimenType> ;
rdfs:label "Fz 10x20"^^xsd:string ;
ns1:wasAttributedTo fileid:TensileTestSpecimen .

fileid:SpecimenWidth a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/SpecimenWidth> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM"^^xsd:anyURI ;
qudt:value "9.5"^^xsd:float ;
ns1:wasAttributedTo fileid:TensileTestSpecimen .

fileid:StandardForce a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/StandardForce> ;
qudt:hasUnit "http://qudt.org/vocab/unit/KiloN"^^xsd:anyURI ;
ns1:wasDerivedFrom fileid:ForceMeasuringDevice .

fileid:TestingRate a ns1:Entity,
<https://w3id.org/steel/ProcessOntology/TestingRate> ;
qudt:hasUnit "http://qudt.org/vocab/unit/MilliM-PER-SEC"^^xsd:anyURI ;
qudt:value "0.02"^^xsd:float ;
ns1:wasAttributedTo fileid:TensileTestingMachine .

fileid:TimeStamp a <https://w3id.org/steel/ProcessOntology/TimeStamp> ;
rdfs:label "2016-10-11 00:00:00"^^xsd:string .

fileid:ForceMeasuringDevice a ns1:Agent,
ns1:Entity ;
ns1:atLocation fileid:TestingLab .

fileid:Tester a ns1:Agent,
<https://w3id.org/steel/ProcessOntology/Tester> ;
rdfs:label "Fe"^^xsd:string ;
ns1:actedOnBehalfOf fileid:TestingFacility ;
ns1:atLocation fileid:TestingLab .

fileid:TensileTestingMachine a ns1:Agent,
ns1:Entity ;
ns1:atLocation fileid:TestingLab .

fileid:TestingFacility a ns1:Location,
ns1:Organization .

fileid:DisplacementTransducer a ns1:Agent,
ns1:Entity ;
ns1:atLocation fileid:TestingLab .

fileid:TestingLab a ns1:Agent,
ns1:Location ;
ns1:atLocation fileid:TestingFacility .

fileid:TensileTestSpecimen a ns1:Agent,
ns1:Entity .
dcterms:identifier "https://www.example.org/column-4"^^xsd:anyURI ;
dcterms:type "http://purl.org/dc/terms/Dataset"^^xsd:anyURI ] ] ] ] .
1 change: 0 additions & 1 deletion tests/abox/xls_pipeline_test/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ def test_excel_pipeline_suffix() -> None:
raw_data=raw_data,
mapping=os.path.join(mapping_folder, "mapping_suffix.json"),
parser=Parser.excel,
additional_triples=template,
parser_args={"dropna": True, "unit_from_macro": True},
)

Expand Down

0 comments on commit d166427

Please sign in to comment.