} foreach ($vars as $var) { if (strpos($var, 'Education_Field_')) { $fieldName = str_replace('_', ' ', substr($var, strlen('Education_Field'))); if ($fieldName == 'Comments') { } else { if (!empty(${$var}) && strtolower(${$var}) != 'no') { $Field = $Rdf->thing_from_label(EUMIDA . 'education-field/', $fieldName, 'en')->a('aiiso:Subject')->is('aiiso:teaches')->of($instUri); } } } } if (!empty($Highest_Degree_Awarded)) { $Rdf->thing_from_label(EUMIDA . 'degree/', $Highest_Degree_Awarded, 'en')->a('eum:EducationDegree')->is('eum:highestDegreeAwarded')->of($instUri); } $dt = empty($Doctorate_Degrees_Awarded) ? false : 'xsd:integer'; $Rdf->thing($instUri . '/doctorates-awarded')->a('qb:Observation')->has('eum:numberOfDoctoratesAwarded')->dt($Doctorate_Degrees_Awarded, $dt)->has('eum:institution')->r($instUri)->has('sdmxdim:refPeriod')->r(YEAR_NS . $Doctorate_Degrees_Awarded_Reference_Year)->is('eum:awardedDoctoratesFigure')->of($instUri)->has('rdfs:comment')->l($Doctorate_Degrees_Comments, 'en')->has('qb:dataSet')->r($doctoratesDatasetUri); $dt = empty($Students_ISCED5) ? false : 'xsd:integer'; $Rdf->thing($instUri . '/ISCED5-Students-enrolled')->a('qb:Observation')->has('eum:numberOfISCED5Students')->dt($Students_ISCED5, $dt)->has('eum:institution')->r($instUri)->has('sdmxdim:refPeriod')->r(YEAR_NS . $Students_ISCED5_Reference_Year)->is('eum:enrolledISCED5StudentsFigure')->of($instUri)->has('rdfs:comment')->l($Students_ISCED5_Comments, 'en')->has('qb:dataSet')->r($studentsISCED5DatasetUri); $dt = empty($International_Students_ISCED5) ? false : 'xsd:integer'; $Rdf->thing($instUri . '/ISCED5-International-Students-enrolled')->a('qb:Observation')->has('eum:numberOfInternationalISCED5Students')->dt($International_Students_ISCED5, $dt)->has('eum:institution')->r($instUri)->has('sdmxdim:refPeriod')->r(YEAR_NS . $International_Students_ISCED5_Reference_Year)->is('eum:enrolledISCED5StudentsFigure')->of($instUri)->has('rdfs:comment')->l($International_Students_ISCED5_Comments, 'en')->has('qb:dataSet')->r($internationStudentsDatasetUri); $dt = empty($Students_ISCED6) ? false : 'xsd:integer'; $Rdf->thing($instUri . '/ISCED6-Students-enrolled')->a('qb:Observation')->has('eum:numberOfISCED6Students')->dt($Students_ISCED6, $dt)->has('eum:institution')->r($instUri)->has('sdmxdim:refPeriod')->r(YEAR_NS . $Students_ISCED6_Reference_Year)->is('eum:enrolledISCED6StudentsFigure')->of($instUri)->has('rdfs:comment')->l($Students_ISCED6_Comments, 'en')->has('qb:dataSet')->r($studentsISCED6DatasetUri); $dt = empty($International_Students_ISCED6) ? false : 'xsd:integer'; $Rdf->thing($instUri . '/ISCED6-International-Students-enrolled')->a('qb:Observation')->has('eum:numberOfInternationalISCED6Students')->dt($International_Students_ISCED6, $dt)->has('eum:institution')->r($instUri)->has('sdmxdim:refPeriod')->r(YEAR_NS . $International_Students_ISCED6_Reference_Year)->is('eum:enrolledInternationalISCED6StudentsFigure')->of($instUri)->has('rdfs:comment')->l($International_Students_ISCED6_Comments, 'en')->has('qb:dataSet')->r($isced6InternationalStudentsDatasetUri); $dt = empty($Total_Staff) ? false : 'xsd:integer'; $Rdf->thing($instUri . '/total-staff')->a('qb:Observation')->has('eum:numberOfStaff')->dt($Total_Staff, $dt)->has('eum:institution')->r($instUri)->has('sdmxdim:refPeriod')->r(YEAR_NS . $Total_Staff_Reference_Year)->is('eum:totalNumberOfStaffFigure')->of($instUri)->has('rdfs:comment')->l($Total_Staff_Comments, 'en')->has('qb:dataSet')->r($totalStaffDatasetUri); echo $Rdf->dump_ntriples(); } $Rdf->write_vocabulary_to_file('eum', 'eumida.vocab.ttl');
$Name = $node->getELementsByTagName('Name')->item(0)->textContent; $kf = array(); $kf['urn'] = $urn; $kf['agencyID'] = $agencyID; $kf['label'] = $Name; $kf['dimension_count'] = 0; $DSD = $rdf->thing_from_identifier(NS . 'dsd/', $id)->a('qb:DataStructureDefinition')->label($Name, 'en')->has('owl:sameAs')->r($urn)->has('dct:creator')->r(NS . 'agency/', $agencyID); foreach ($node->getElementsByTagName('Dimension') as $Dimension) { $kf['dimension_count']++; $kf['dimensions'][$Dimension->getAttribute('conceptRef')] = $Dimension->getAttribute('codelist'); $rdf->thing_from_identifier(NS . 'component-specification', $id . '-' . $Dimension->getAttribute('conceptRef'))->a('qb:ComponentSpecification')->has('qb:dimension')->r(NS . 'schema/' . $Dimension->getAttribute('conceptRef'))->is('qb:component')->of($DSD->get_uri()); echo $rdf->dump_ntriples(); } echo $rdf->dump_ntriples(); // $keyFamilies[$id] = $kf; } } } } break; } } $rdf->write_vocabulary_to_file('ecbstats', 'ecbstats.ttl'); exit; $output['concepts'] = $concepts; $output['codes'] = $codeLists; $output['key_families'] = $keyFamilies; echo json_encode($output); ?>