Changeset 7799 for mauRepo/xml2owl
- Timestamp:
- 06/01/11 12:49:51 (10 years ago)
- Location:
- mauRepo/xml2owl/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/xml2owl/trunk/config/checkstyle.xml
r7757 r7799 157 157 <module name="BooleanExpressionComplexity"> 158 158 <property name="severity" value="error"/> 159 <property name="max" value=" 2"/>159 <property name="max" value="6"/> 160 160 </module> 161 161 <module name="AvoidInlineConditionals"> -
mauRepo/xml2owl/trunk/protege.properties
r7779 r7799 1 1 #Protege Properties 2 #Wed Dec 15 13:42:51 GMT 2010 2 #Thu Jan 06 12:36:08 GMT 2011 3 SwitchableClassDefinitionType=edu.stanford.smi.protegex.owl.ui.cls.LogicClassDefinitionWidgetType 3 4 history.projects.reopen=file\:/home/users/mnagni/workspace/ESGGateway/metafor/examples/newspaper/newspaper.pprj,file\:/home/users/mnagni/workspace/ESGGateway/metafor/examples/pizza/pizza.owl.pprj 4 SwitchableClassDefinitionType=edu.stanford.smi.protegex.owl.ui.cls.LogicClassDefinitionWidgetType -
mauRepo/xml2owl/trunk/src/main/java/ndg/ontology/OntIngester.java
r7779 r7799 35 35 import java.io.OutputStream; 36 36 import java.util.Iterator; 37 import java.util.Properties; 37 38 38 39 import javax.xml.bind.JAXBException; … … 52 53 import ndg.ontology.parser.model.StatementSupport; 53 54 54 import org.badc.ndg.ontologyingester.AddComment; 55 import org.badc.ndg.ontologyingester.AddLabel; 56 import org.badc.ndg.ontologyingester.AddTriple; 57 import org.badc.ndg.ontologyingester.AddTripleLiteral; 55 import org.badc.ndg.ontologyingester.ActionDetail; 56 import org.badc.ndg.ontologyingester.ActionDetailsType; 57 import org.badc.ndg.ontologyingester.AddCommentType; 58 import org.badc.ndg.ontologyingester.AddLabelType; 59 import org.badc.ndg.ontologyingester.AddTripleLiteralType; 60 import org.badc.ndg.ontologyingester.AddTripleType; 58 61 import org.badc.ndg.ontologyingester.Ingester; 62 import org.badc.ndg.ontologyingester.OntElement; 59 63 import org.slf4j.Logger; 60 64 import org.slf4j.LoggerFactory; … … 71 75 /** The Constant LOG. */ 72 76 private static final Logger LOGGER = LoggerFactory.getLogger(OntIngester.class); 73 77 74 78 private final DocumentHelper dh = new DocumentHelper(); 75 79 private final JAXBManager manager; … … 84 88 85 89 private String separator = ";;"; 90 91 // String sbjVal = null; 92 // String predVal = null; 93 // String predURI = null; 94 95 private enum TCOMPONENT { 96 SBJ_URI, OBJ_URI, PRED_URI, PRED_VAL, SBJ_VAL, OBJ_VAL 97 }; 98 99 private enum ACTION { 100 ADD_TRIPLE, ADD_LABEL, ADD_TRIPLE_LITERAL, ADD_COMMENT 101 }; 86 102 87 103 OntIngester(final InputStream ingesterConfig, final StatementSupport statementSupport, … … 105 121 } 106 122 xqe.bindNode(XQConstants.CONTEXT_ITEM, doc, null); 107 ingest(ing.getAddTriple().iterator(), xqe); 108 ingest(ing.getAddLabel().iterator(), xqe); 109 ingest(ing.getAddTripleLiteral().iterator(), xqe); 110 ingest(ing.getAddComment().iterator(), xqe); 123 ingest(ing.getAction().iterator(), xqe); 111 124 } 112 125 … … 117 130 return; 118 131 } 119 120 132 121 133 if (ing.getConfiguration().getSeparator() != null) { 122 134 separator = ing.getConfiguration().getSeparator(); 123 135 } 124 125 136 126 137 for (org.badc.ndg.ontologyingester.Node node : ing.getConfiguration().getNode()) { … … 139 150 } 140 151 141 private <T> void ingest(final Iterator<T> ops, final XQExpression xqe) throws XPathExpressionException { 142 while (ops.hasNext()) { 143 T obj = ops.next(); 152 private void ingest(final Iterator<ActionDetail> actions, final XQExpression xqe) { 153 ActionDetail act = null; 154 while (actions.hasNext()) { 155 act = actions.next(); 144 156 try { 145 if (obj instanceof AddLabel) { 146 process((AddLabel) obj, xqe); 147 } else if (obj instanceof AddTriple) { 148 process((AddTriple) obj, xqe); 149 } else if (obj instanceof AddTripleLiteral) { 150 process((AddTripleLiteral) obj, xqe); 151 } else if (obj instanceof AddComment) { 152 process((AddComment) obj, xqe); 153 } 154 155 } catch (StatementSupportException e) { 156 if (LOGGER.isErrorEnabled()) { 157 LOGGER.error("Error! But continuing to loop. Detailed error follows ", e); 158 } 157 XQResultSequence triples = executeXQuery(xqe, act.getXquery()); 158 process(act.getActionType().getValue(), triples); 159 159 } catch (XQException e) { 160 160 if (LOGGER.isErrorEnabled()) { 161 LOGGER.error("Error! But continuing to loop. Detailed error follows ", e); 161 LOGGER.error("Error! But continuing to loop. Detailed error follows ", e); 162 } 163 } 164 } 165 } 166 167 private void process(final ActionDetailsType type, final XQResultSequence triples) throws XQException { 168 String atVal = null; 169 while (triples.next()) { 170 atVal = triples.getAtomicValue().trim(); 171 try { 172 if (type instanceof AddLabelType) { 173 process((AddLabelType) type, atVal); 174 } else if (type instanceof AddTripleType) { 175 process((AddTripleType) type, atVal); 176 } else if (type instanceof AddTripleLiteralType) { 177 process((AddTripleLiteralType) type, atVal); 178 } else if (type instanceof AddCommentType) { 179 process((AddCommentType) type, atVal); 162 180 } 163 181 } catch (Exception e) { 164 182 if (LOGGER.isErrorEnabled()) { 165 LOGGER.error("Error! But continuing to loop. Detailed error follows ", e); 183 LOGGER.error("Error! But continuing to loop. Detailed error follows ", e); 166 184 } 167 185 } 168 186 } 169 }170 171 private void process(final AddLabel item, final XQExpression xqe) throws XPathExpressionException, XQException,172 StatementSupportException {173 String sbjClass = item.getOntSubject().trim();174 XQResultSequence triples = executeXQuery(xqe, item.getXquery());175 176 while (triples.next()) {177 String atVal = triples.getAtomicValue().trim();178 179 String[] values = doSplit(atVal);180 if (values.length != 2) {181 continue;182 }183 184 statementSupport.addLabel(sbjClass, values[0].trim(), values[1].trim());185 }186 187 187 triples.close(); 188 188 } 189 189 190 private void process(final AddComment item, final XQExpression xqe) throws XPathExpressionException, XQException, 191 StatementSupportException { 192 String sbjClass = item.getOntSubject().trim(); 193 XQResultSequence triples = executeXQuery(xqe, item.getXquery()); 194 195 while (triples.next()) { 196 String atVal = triples.getAtomicValue().trim(); 197 198 String[] values = doSplit(atVal); 199 if (values.length != 2) { 200 continue; 201 } 202 statementSupport.addComment(sbjClass, values[0].trim(), values[1].trim()); 203 } 204 205 triples.close(); 206 } 207 208 private void process(final AddTripleLiteral item, final XQExpression xqe) throws XPathExpressionException, 209 XQException, StatementSupportException { 210 String sbjClass = item.getOntSubject().trim(); 211 String ontPredicate = ""; 190 private void process(final AddLabelType item, final String atVal) throws StatementSupportException { 191 Properties prop = loadData(doSplit(atVal), ACTION.ADD_COMMENT, item.getOntSubject(), null, null); 192 193 statementSupport.addLabel(prop.getProperty(TCOMPONENT.SBJ_URI.toString()), prop.getProperty(TCOMPONENT.SBJ_VAL 194 .toString()), prop.getProperty(TCOMPONENT.PRED_VAL.toString())); 195 } 196 197 private void process(final AddCommentType item, final String atVal) throws StatementSupportException { 198 Properties prop = loadData(doSplit(atVal), ACTION.ADD_COMMENT, item.getOntSubject(), null, null); 199 statementSupport.addComment(prop.getProperty(TCOMPONENT.SBJ_URI.toString()), prop 200 .getProperty(TCOMPONENT.SBJ_VAL.toString()), prop.getProperty(TCOMPONENT.PRED_VAL.toString())); 201 } 202 203 private void process(final AddTripleLiteralType item, final String atVal) throws StatementSupportException { 204 212 205 if (item.getOntPredicate() == null) { 213 206 throw new StatementSupportException("ontPredicate cannot be null!"); 214 207 } 215 216 if (item.getOntPredicate().getUri() != null) { 217 ontPredicate = item.getOntPredicate().getUri().trim(); 218 } 219 220 221 XQResultSequence triples = executeXQuery(xqe, item.getXquery()); 222 223 while (triples.next()) { 224 String atVal = triples.getAtomicValue().trim(); 225 226 String[] values = doSplit(atVal); 227 String sbjURI = null; 228 String objURI = null; 229 String predURI = null; 230 if (item.getOntPredicate().isDynamic() != null && item.getOntPredicate().isDynamic()) { 231 if (values.length != 3) { 232 continue; 233 } 234 sbjURI = values[0]; 235 objURI = values[1]; 236 predURI = values[2]; 237 } else { 238 if (values.length != 2) { 239 continue; 240 } 241 sbjURI = values[0].trim(); 242 objURI = values[1].trim(); 243 predURI = ontPredicate; 244 } 245 statementSupport.addLiteral(sbjClass, sbjURI, predURI, objURI); 246 } 247 248 triples.close(); 249 } 250 251 private void process(final AddTriple item, final XQExpression xqe) throws XPathExpressionException, XQException, 252 StatementSupportException { 253 String sbjClass = item.getOntSubject().trim(); 254 String objClass = item.getOntObject().trim(); 255 String ontPredicate = item.getOntPredicate().getUri().trim(); 256 257 XQResultSequence triples = executeXQuery(xqe, item.getXquery()); 258 259 while (triples.next()) { 260 String atVal = triples.getAtomicValue().trim(); 261 262 String[] values = doSplit(atVal); 263 if (values.length != 2) { 264 continue; 265 } 266 267 statementSupport.addProperty(sbjClass, values[0].trim(), ontPredicate, objClass, values[1].trim()); 268 } 269 270 triples.close(); 208 209 Properties prop = loadData(doSplit(atVal), ACTION.ADD_TRIPLE_LITERAL, item.getOntSubject(), item 210 .getOntPredicate(), null); 211 statementSupport.addLiteral(prop.getProperty(TCOMPONENT.SBJ_URI.toString()), prop 212 .getProperty(TCOMPONENT.SBJ_VAL.toString()), prop.getProperty(TCOMPONENT.PRED_URI.toString()), prop 213 .getProperty(TCOMPONENT.PRED_VAL.toString())); 214 } 215 216 private void process(final AddTripleType item, final String atVal) throws StatementSupportException { 217 Properties prop = loadData(doSplit(atVal), ACTION.ADD_TRIPLE, item.getOntSubject(), item.getOntPredicate(), 218 item.getOntObject()); 219 220 statementSupport.addProperty(prop.getProperty(TCOMPONENT.SBJ_URI.toString()), prop 221 .getProperty(TCOMPONENT.SBJ_VAL.toString()), prop.getProperty(TCOMPONENT.PRED_URI.toString()), prop 222 .getProperty(TCOMPONENT.OBJ_URI.toString()), prop.getProperty(TCOMPONENT.OBJ_VAL.toString())); 223 } 224 225 private Properties loadData(final String[] values, final ACTION action, final OntElement subject, 226 final OntElement predicate, final OntElement object) throws StatementSupportException { 227 Properties ret = new Properties(); 228 if (subject != null && subject.getUri() != null) { 229 ret.put(TCOMPONENT.SBJ_URI.toString(), subject.getUri().trim()); 230 } 231 232 if (predicate != null && predicate.getUri() != null) { 233 ret.put(TCOMPONENT.PRED_URI.toString(), predicate.getUri().trim()); 234 } 235 236 if (object != null && object.getUri() != null) { 237 ret.put(TCOMPONENT.OBJ_URI.toString(), object.getUri().trim()); 238 } 239 240 if (values.length == 5 && (predicate != null) && (object != null) 241 && (predicate.isDynamic() != null && predicate.isDynamic()) 242 && (object.isDynamic() != null && object.isDynamic())) { 243 switch (action) { 244 case ADD_TRIPLE: 245 ret.put(TCOMPONENT.SBJ_VAL.toString(), values[0].trim()); 246 ret.put(TCOMPONENT.PRED_VAL.toString(), values[1].trim()); 247 ret.put(TCOMPONENT.PRED_URI.toString(), values[2].trim()); 248 ret.put(TCOMPONENT.OBJ_VAL.toString(), values[3].trim()); 249 ret.put(TCOMPONENT.OBJ_URI.toString(), values[4].trim()); 250 default: 251 } 252 return ret; 253 } 254 255 if (values.length == 3 && (predicate != null) && (predicate.isDynamic() != null && predicate.isDynamic())) { 256 switch (action) { 257 case ADD_TRIPLE_LITERAL: 258 ret.put(TCOMPONENT.SBJ_VAL.toString(), values[0].trim()); 259 ret.put(TCOMPONENT.PRED_VAL.toString(), values[1].trim()); 260 ret.put(TCOMPONENT.PRED_URI.toString(), values[2].trim()); 261 default: 262 } 263 return ret; 264 } 265 266 if (values.length == 3 && (object != null) && (object.isDynamic() != null && object.isDynamic())) { 267 switch (action) { 268 case ADD_TRIPLE: 269 ret.put(TCOMPONENT.SBJ_VAL.toString(), values[0].trim()); 270 ret.put(TCOMPONENT.OBJ_VAL.toString(), values[1].trim()); 271 ret.put(TCOMPONENT.OBJ_URI.toString(), values[2].trim()); 272 default: 273 } 274 return ret; 275 } 276 277 if (values.length == 2) { 278 switch (action) { 279 case ADD_TRIPLE: 280 ret.put(TCOMPONENT.SBJ_VAL.toString(), values[0].trim()); 281 ret.put(TCOMPONENT.OBJ_VAL.toString(), values[1].trim()); 282 default: 283 ret.put(TCOMPONENT.SBJ_VAL.toString(), values[0].trim()); 284 ret.put(TCOMPONENT.PRED_VAL.toString(), values[1].trim()); 285 } 286 return ret; 287 } 288 throw new StatementSupportException("No values can be loaded"); 271 289 } 272 290 -
mauRepo/xml2owl/trunk/src/main/java/ndg/ontology/parser/support/ProtegeeOntSupport.java
r7779 r7799 45 45 } 46 46 OWLIndividual individual = model.getOWLIndividual(indURI); 47 if (individual == null || !individual.hasRDFType(clazz)) {47 if (individual == null /*|| !individual.hasRDFType(clazz)*/) { 48 48 individual = clazz.createOWLIndividual(indURI); 49 49 } … … 64 64 65 65 private RDFProperty getObjectProperty(final String propertyURI) throws IndividualException { 66 Object ret = model.getOWLObjectProperty(propertyURI); 66 Object ret = null; 67 try { 68 ret = model.getOWLObjectProperty(propertyURI); 69 } catch (ClassCastException ex) { 70 ex.getMessage(); 71 } 72 67 73 if (ret == null) { 68 74 throw new IndividualException("Cannot create Property(" + propertyURI + ")"); -
mauRepo/xml2owl/trunk/src/test/java/ndg/ontology/parser/TestBindDOM.java
r7797 r7799 50 50 String rootPath = "/home/users/mnagni/workspace/ESGGateway/metafor/src/test/resources"; 51 51 52 //String path = rootPath + "/sample_cmip5qn_100930_mark.xml";53 String path = rootPath + "/PersistedXML";52 String path = rootPath + "/sample_cmip5qn_100930_mark.xml"; 53 //String path = rootPath + "/PersistedXML"; 54 54 55 55 File[] files = getPaths(path); … … 81 81 82 82 private InputStream getIngesterConfig() { 83 //String sample = "/ingesterConfig.xml";84 String sample = "/experimentIngestConfig.xml";83 String sample = "/ingesterConfig.xml"; 84 //String sample = "/experimentIngestConfig.xml"; 85 85 return getClass().getResourceAsStream(sample); 86 86 } -
mauRepo/xml2owl/trunk/src/test/resources/MetaforESGMapping.xml
r7797 r7799 1 1 <ndg:lookup xmlns:ndg="http://www.ndg.ac.uk"> 2 3 <!-- METAFOR_ESG_INPUT_TYPE_MAP --> 2 4 <ndg:entry metaforName="boundaryCondition" esgName="boundary" /> 3 5 <ndg:entry metaforName="initialCondition" esgName="initial" /> 4 6 <ndg:entry metaforName="ancillaryFile" esgName="ancillary" /> 7 8 <!-- METAFOR_ESG_TIME_TRANSFORMATION_MAP --> 9 <ndg:entry metaforName="TimeAverage" esgName="time_average" /> 10 <ndg:entry metaforName="TimeInterpolation" esgName="time_interpolation" /> 11 12 <!-- METAFOR_ESG_PHYSICAL_DOMAIN_MAP --> 13 <ndg:entry metaforName="aerosol" esgName="Atmosphere" /> 14 <ndg:entry metaforName="Aerosols" esgName="Atmosphere" /> 15 <ndg:entry metaforName="AtmosphericChemistry" esgName="Atmosphere" /> 16 <ndg:entry metaforName="atmos" esgName="Atmosphere" /> 17 <ndg:entry metaforName="atmosphere" esgName="Atmosphere" /> 18 <ndg:entry metaforName="Atmosphere" esgName="Atmosphere" /> 19 <ndg:entry metaforName="aerosol" esgName="Atmosphere" /> 20 <ndg:entry metaforName="land" esgName="Land" /> 21 <ndg:entry metaforName="landIce" esgName="Land" /> 22 <ndg:entry metaforName="LandIce" esgName="Land" /> 23 <ndg:entry metaforName="LandSurface" esgName="Land" /> 24 <ndg:entry metaforName="ocean" esgName="Ocean" /> 25 <ndg:entry metaforName="OceanBiogeoChemistry" esgName="Ocean" /> 26 <ndg:entry metaforName="ocnBgchem" esgName="Ocean" /> 27 <ndg:entry metaforName="seaIce" esgName="Ice" /> 5 28 </ndg:lookup> -
mauRepo/xml2owl/trunk/src/test/resources/experimentIngestConfig.xml
r7779 r7799 6 6 <ndg:node external="lookup" path="/home/users/mnagni/workspace/ESGGateway/metafor/src/test/resources/lookup.xml"/> 7 7 --> 8 < ndg:separator><![CDATA[;;]]></ndg:separator>8 <separator><![CDATA[;;]]></separator> 9 9 </ndg:configuration> 10 10 11 11 <!-- NUMERICAL_REQUIREMENTS.label --> 12 <ndg: addLabel>13 <ndg: ontSubject>14 http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements15 </ndg: ontSubject>16 < ndg:xquery>12 <ndg:Action> 13 <ndg:addLabel> 14 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements"/> 15 </ndg:addLabel> 16 <xquery> 17 17 <![CDATA[ 18 18 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; … … 22 22 concat($sn/id, ";;", $sn/id) 23 23 ]]> 24 </ ndg:xquery>25 </ndg: addLabel>24 </xquery> 25 </ndg:Action> 26 26 27 27 <!-- NUMERICAL_REQUIREMENTS.comment --> 28 <ndg: addComment>29 <ndg: ontSubject>30 http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements31 </ndg: ontSubject>32 < ndg:xquery>28 <ndg:Action> 29 <ndg:addComment> 30 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements"/> 31 </ndg:addComment> 32 <xquery> 33 33 <![CDATA[ 34 34 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; … … 37 37 return 38 38 concat($sn/id, ";;", $sn/description) 39 ]]> 40 </ ndg:xquery>41 </ndg: addComment>39 ]]> 40 </xquery> 41 </ndg:Action> 42 42 43 43 <!-- NUMERICAL_REQUIREMENTS.triple --> 44 <ndg:addTriple> 45 <ndg:ontSubject> 46 http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements 47 </ndg:ontSubject> 48 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputType"/> 49 <ndg:ontObject> 50 http://www.earthsystemgrid.org/esg.owl#InputCondition 51 </ndg:ontObject> 52 <ndg:xquery> 44 <ndg:Action> 45 <ndg:addTriple> 46 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements"/> 47 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputType"/> 48 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 49 </ndg:addTriple> 50 <xquery> 53 51 <![CDATA[ 54 52 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; … … 63 61 then concat($sn/id, ";;", 'ancillary') 64 62 else empty 65 ]]> 66 </ndg:xquery> 67 </ndg:addTriple> 63 ]]> 64 </xquery> 65 </ndg:Action> 66 68 67 69 68 <!-- NUMERICAL_EXPERIMENT.label --> 70 <ndg: addLabel>71 <ndg: ontSubject>72 http://www.earthsystemgrid.org/esg.owl#Experiment73 </ndg: ontSubject>74 < ndg:xquery>69 <ndg:Action> 70 <ndg:addLabel> 71 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 72 </ndg:addLabel> 73 <xquery> 75 74 <![CDATA[ 76 75 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; … … 78 77 concat(numericalExperiment/documentID, ";;", numericalExperiment/rationale) 79 78 ]]> 80 </ndg:xquery> 81 </ndg:addLabel> 82 79 </xquery> 80 </ndg:Action> 81 82 83 83 <!-- NUMERICAL_EXPERIMENT.comment --> 84 <ndg: addComment>85 <ndg: ontSubject>86 http://www.earthsystemgrid.org/esg.owl#Experiment87 </ndg: ontSubject>88 < ndg:xquery>84 <ndg:Action> 85 <ndg:addComment> 86 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 87 </ndg:addComment> 88 <xquery> 89 89 <![CDATA[ 90 90 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; … … 92 92 concat(numericalExperiment/documentID, ";;", numericalExperiment/rationale) 93 93 ]]> 94 </ndg:xquery> 95 </ndg:addComment> 94 </xquery> 95 </ndg:Action> 96 96 97 97 98 <!-- NUMERICAL_EXPERIMENT.literals --> 98 <ndg: addTripleLiteral>99 <ndg: ontSubject>100 http://www.earthsystemgrid.org/esg.owl#Experiment101 </ndg:ontSubject>102 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentRationale"/>103 < ndg:xquery>99 <ndg:Action> 100 <ndg:addTripleLiteral> 101 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 102 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentRationale"/> 103 </ndg:addTripleLiteral> 104 <xquery> 104 105 <![CDATA[ 105 106 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; 106 107 declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; 107 108 concat(numericalExperiment/documentID, ";;", numericalExperiment/rationale) 108 ]]> 109 </ ndg:xquery>110 </ndg: addTripleLiteral>109 ]]> 110 </xquery> 111 </ndg:Action> 111 112 112 <ndg: addTripleLiteral>113 <ndg: ontSubject>114 http://www.earthsystemgrid.org/esg.owl#Experiment115 </ndg:ontSubject>116 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentStartDate"/>117 < ndg:xquery>113 <ndg:Action> 114 <ndg:addTripleLiteral> 115 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 116 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentStartDate"/> 117 </ndg:addTripleLiteral> 118 <xquery> 118 119 <![CDATA[ 119 120 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; 120 121 declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; 121 122 concat(numericalExperiment/documentID, ";;", numericalExperiment/numericalRequirement/requiredDuration/startDate) 122 ]]> 123 </ ndg:xquery>124 </ndg: addTripleLiteral>123 ]]> 124 </xquery> 125 </ndg:Action> 125 126 126 <ndg: addTripleLiteral>127 <ndg: ontSubject>128 http://www.earthsystemgrid.org/esg.owl#Experiment129 </ndg:ontSubject>130 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentEndDate"/>131 < ndg:xquery>127 <ndg:Action> 128 <ndg:addTripleLiteral> 129 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 130 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentEndDate"/> 131 </ndg:addTripleLiteral> 132 <xquery> 132 133 <![CDATA[ 133 134 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; 134 135 declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; 135 136 concat(numericalExperiment/documentID, ";;", numericalExperiment/numericalRequirement/requiredDuration/endDate) 136 ]]> 137 </ ndg:xquery>138 </ndg: addTripleLiteral>137 ]]> 138 </xquery> 139 </ndg:Action> 139 140 140 <ndg: addTripleLiteral>141 <ndg: ontSubject>142 http://www.earthsystemgrid.org/esg.owl#Experiment143 </ndg:ontSubject>144 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentNumber"/>145 < ndg:xquery>141 <ndg:Action> 142 <ndg:addTripleLiteral> 143 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 144 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentNumber"/> 145 </ndg:addTripleLiteral> 146 <xquery> 146 147 <![CDATA[ 147 148 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; 148 149 declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; 149 150 concat(numericalExperiment/documentID, ";;", numericalExperiment/documentID) 150 ]]> 151 </ndg:xquery> 152 </ndg:addTripleLiteral> 151 ]]> 152 </xquery> 153 </ndg:Action> 154 153 155 154 156 <!-- NUMERICAL_EXPERIMENT.triple --> 155 <ndg:addTriple> 156 <ndg:ontSubject> 157 http://www.earthsystemgrid.org/esg.owl#Experiment 158 </ndg:ontSubject> 159 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasProject"/> 160 <ndg:ontObject> 161 http://www.earthsystemgrid.org/esg.owl#Project 162 </ndg:ontObject> 163 <ndg:xquery> 157 <ndg:Action> 158 <ndg:addTriple> 159 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 160 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasProject"/> 161 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Project"/> 162 </ndg:addTriple> 163 <xquery> 164 164 <![CDATA[ 165 165 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; 166 166 declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; 167 167 concat(numericalExperiment/documentID, ";;", 'cmip5') 168 ]]> 169 </ ndg:xquery>170 </ndg: addTriple>168 ]]> 169 </xquery> 170 </ndg:Action> 171 171 172 <ndg:addTriple> 173 <ndg:ontSubject> 174 http://www.earthsystemgrid.org/esg.owl#Experiment 175 </ndg:ontSubject> 176 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentalRequirement"/> 177 <ndg:ontObject> 178 http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements 179 </ndg:ontObject> 180 <ndg:xquery> 172 <ndg:Action> 173 <ndg:addTriple> 174 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Experiment"/> 175 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentalRequirement"/> 176 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalRequirements"/> 177 </ndg:addTriple> 178 <xquery> 181 179 <![CDATA[ 182 180 declare default element namespace "http://www.metaforclimate.eu/cim/1.4"; … … 185 183 return 186 184 concat(numericalExperiment/documentID, ";;", $sn/id) 187 ]]> 188 </ndg:xquery> 189 </ndg:addTriple> 190 185 ]]> 186 </xquery> 187 </ndg:Action> 191 188 </ndg:ingester> -
mauRepo/xml2owl/trunk/src/test/resources/ingesterConfig.xml
r7797 r7799 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <ndg:ingester xmlns:ndg="http://ndg.badc.org/ontologyIngester"> 3 3 4 4 5 <ndg:configuration> 5 6 <ndg:node external="lookup" path="/home/users/mnagni/workspace/ESGGateway/metafor/src/test/resources/lookup.xml"/> 6 7 <ndg:node external="metaforMapping" path="/home/users/mnagni/workspace/ESGGateway/metafor/src/test/resources/MetaforESGMapping.xml"/> 7 < ndg:separator><![CDATA[;;]]></ndg:separator>8 <separator><![CDATA[;;]]></separator> 8 9 </ndg:configuration> 9 10 10 11 <!-- PLATFORM --> 11 12 <!-- PLATFORM.triples --> 12 <ndg:addTriple> 13 <ndg:ontSubject> 14 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment 15 </ndg:ontSubject> 16 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasOperatingSystem"/> 17 <ndg:ontObject> 18 http://www.earthsystemgrid.org/esg.owl#OperatingSystem 19 </ndg:ontObject> 20 <ndg:xquery> 13 <ndg:Action> 14 <ndg:addTriple> 15 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 16 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasOperatingSystem"/> 17 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#OperatingSystem"/> 18 </ndg:addTriple> 19 <xquery> 21 20 <![CDATA[ 22 21 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 27 26 $compVer in $plat/compiler/compilerVersion 28 27 return 29 concat($ mac/machineName, "_",28 concat($plat/documentID, "_", $mac/machineName, "_", 30 29 $mac/machineVendor, "_", 31 30 $compName, "_", 32 31 $compVer, ";;", $obj)]]> 33 </ndg:xquery> 34 </ndg:addTriple> 35 36 <ndg:addTriple> 37 <ndg:ontSubject> 38 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment 39 </ndg:ontSubject> 40 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasProcessor"/> 41 <ndg:ontObject> 42 http://www.earthsystemgrid.org/esg.owl#Processor 43 </ndg:ontObject> 44 <ndg:xquery> 32 </xquery> 33 </ndg:Action> 34 35 <ndg:Action> 36 <ndg:addTriple> 37 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 38 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasProcessor"/> 39 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Processor"/> 40 </ndg:addTriple> 41 <xquery> 45 42 <![CDATA[ 46 43 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 51 48 $compVer in $plat/compiler/compilerVersion 52 49 return 53 concat($ mac/machineName, "_",50 concat($plat/documentID, "_", $mac/machineName, "_", 54 51 $mac/machineVendor, "_", 55 52 $compName, "_", 56 53 $compVer, ";;", $obj)]]> 57 </ndg:xquery> 58 </ndg:addTriple> 59 60 <ndg:addTriple> 61 <ndg:ontSubject> 62 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment 63 </ndg:ontSubject> 64 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasHardwareType"/> 65 <ndg:ontObject> 66 http://www.earthsystemgrid.org/esg.owl#HardwareType 67 </ndg:ontObject> 68 <ndg:xquery> 54 </xquery> 55 </ndg:Action> 56 57 <ndg:Action> 58 <ndg:addTriple> 59 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 60 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasHardwareType"/> 61 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#HardwareType"/> 62 </ndg:addTriple> 63 <xquery> 69 64 <![CDATA[ 70 65 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 75 70 $compVer in $plat/compiler/compilerVersion 76 71 return 77 concat($ mac/machineName, "_",72 concat($plat/documentID, "_", $mac/machineName, "_", 78 73 $mac/machineVendor, "_", 79 74 $compName, "_", 80 75 $compVer, ";;", $obj)]]> 81 </ndg:xquery> 82 </ndg:addTriple> 83 84 <ndg:addTriple> 85 <ndg:ontSubject> 86 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment 87 </ndg:ontSubject> 88 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInterconnectType"/> 89 <ndg:ontObject> 90 http://www.earthsystemgrid.org/esg.owl#InterconnectType 91 </ndg:ontObject> 92 <ndg:xquery> 76 </xquery> 77 </ndg:Action> 78 79 <ndg:Action> 80 <ndg:addTriple> 81 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 82 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInterconnectType"/> 83 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InterconnectType"/> 84 </ndg:addTriple> 85 <xquery> 93 86 <![CDATA[ 94 87 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 99 92 $compVer in $plat/compiler/compilerVersion 100 93 return 101 concat($ mac/machineName, "_",94 concat($plat/documentID, "_", $mac/machineName, "_", 102 95 $mac/machineVendor, "_", 103 96 $compName, "_", 104 97 $compVer, ";;", $obj)]]> 105 </ndg:xquery> 106 </ndg:addTriple> 107 108 <ndg:addTriple> 109 <ndg:ontSubject> 110 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment 111 </ndg:ontSubject> 112 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasLanguageCompiler"/> 113 <ndg:ontObject> 114 http://www.earthsystemgrid.org/esg.owl#LanguageCompiler 115 </ndg:ontObject> 116 <ndg:xquery> 98 </xquery> 99 </ndg:Action> 100 101 <ndg:Action> 102 <ndg:addTriple> 103 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 104 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasLanguageCompiler"/> 105 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#LanguageCompiler"/> 106 </ndg:addTriple> 107 <xquery> 117 108 <![CDATA[ 118 109 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 122 113 $compVer in $plat/compiler/compilerVersion 123 114 return 124 concat($ mac/machineName, "_",115 concat($plat/documentID, "_", $mac/machineName, "_", 125 116 $mac/machineVendor, "_", 126 117 $compName, "_", 127 118 $compVer, ";;", $compName, "_", $compVer)]]> 128 </ndg:xquery> 129 </ndg:addTriple> 119 </xquery> 120 </ndg:Action> 121 122 130 123 131 124 <!-- PLATFORM.labels --> 132 <ndg: addLabel>133 <ndg: ontSubject>134 http://www.earthsystemgrid.org/esg.owl#LanguageCompiler135 </ndg: ontSubject>136 < ndg:xquery>125 <ndg:Action> 126 <ndg:addLabel> 127 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#LanguageCompiler"/> 128 </ndg:addLabel> 129 <xquery> 137 130 <![CDATA[ 138 131 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 141 134 $compVer in $comp/compilerVersion 142 135 return 143 concat($compName, "_", $compVer, ";;", $compName, "_", $compVer)]]> 144 </ ndg:xquery>145 </ndg: addLabel>136 concat($compName, "_", $compVer, ";;", $compName, "_", $compVer)]]> 137 </xquery> 138 </ndg:Action> 146 139 147 140 <!-- PLATFORM.literals --> 148 <ndg: addTripleLiteral>149 <ndg: ontSubject>150 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment151 </ndg:ontSubject>152 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasMaxProcessors"/>153 < ndg:xquery>141 <ndg:Action> 142 <ndg:addTripleLiteral> 143 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 144 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasMaxProcessors"/> 145 </ndg:addTripleLiteral> 146 <xquery> 154 147 <![CDATA[ 155 148 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 159 152 $compVer in $plat/compiler/compilerVersion 160 153 return 161 concat($ mac/machineName, "_",154 concat($plat/documentID, "_", $mac/machineName, "_", 162 155 $mac/machineVendor, "_", 163 156 $compName, "_", 164 $compVer, ";;", $mac/machineMaximumProcessors)]]> 165 </ ndg:xquery>166 </ndg: addTripleLiteral>167 168 <ndg: addTripleLiteral>169 <ndg: ontSubject>170 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment171 </ndg:ontSubject>172 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasCoresPerProcessor"/>173 < ndg:xquery>157 $compVer, ";;", $mac/machineMaximumProcessors)]]> 158 </xquery> 159 </ndg:Action> 160 161 <ndg:Action> 162 <ndg:addTripleLiteral> 163 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 164 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasCoresPerProcessor"/> 165 </ndg:addTripleLiteral> 166 <xquery> 174 167 <![CDATA[ 175 168 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 179 172 $compVer in $plat/compiler/compilerVersion 180 173 return 181 concat($ mac/machineName, "_",174 concat($plat/documentID, "_", $mac/machineName, "_", 182 175 $mac/machineVendor, "_", 183 176 $compName, "_", 184 $compVer, ";;", $mac/machineCoresPerProcessor)]]> 185 </ ndg:xquery>186 </ndg: addTripleLiteral>187 188 <ndg: addTripleLiteral>189 <ndg: ontSubject>190 http://www.earthsystemgrid.org/esg.owl#LanguageCompiler191 </ndg:ontSubject>192 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasLanguageCompilerVersion"/>193 < ndg:xquery>177 $compVer, ";;", $mac/machineCoresPerProcessor)]]> 178 </xquery> 179 </ndg:Action> 180 181 <ndg:Action> 182 <ndg:addTripleLiteral> 183 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#LanguageCompiler"/> 184 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasLanguageCompilerVersion"/> 185 </ndg:addTripleLiteral> 186 <xquery> 194 187 <![CDATA[ 195 188 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 199 192 return 200 193 concat($compName, "_", 201 $compVer, ";;", $compVer)]]> 202 </ndg:xquery> 203 </ndg:addTripleLiteral> 194 $compVer, ";;", $compVer)]]> 195 </xquery> 196 </ndg:Action> 197 204 198 205 199 <!-- SIMULATION_RUN --> 206 200 <!-- SIMULATION_RUN.label --> 207 <ndg: addLabel>208 <ndg: ontSubject>209 http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance210 </ndg: ontSubject>211 < ndg:xquery>201 <ndg:Action> 202 <ndg:addLabel> 203 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance"/> 204 </ndg:addLabel> 205 <xquery> 212 206 <![CDATA[ 213 207 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 214 208 for $sn in //CIMRecord/simulationRun//conformance/requirement/reference 215 209 return 216 concat( $sn/name, ";;", $sn/description)217 ]]> 218 </ ndg:xquery>219 </ndg: addLabel>210 concat(//CIMRecord/simulationRun/documentID, "_", $sn/name, ";;", $sn/description) 211 ]]> 212 </xquery> 213 </ndg:Action> 220 214 221 215 <!-- SIMULATION_RUN.comment --> 222 <ndg: addComment>223 <ndg: ontSubject>224 http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance225 </ndg: ontSubject>226 < ndg:xquery>216 <ndg:Action> 217 <ndg:addComment> 218 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance"/> 219 </ndg:addComment> 220 <xquery> 227 221 <![CDATA[ 228 222 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 230 224 $ref in $conf/requirement/reference 231 225 return 232 concat($ref/name, ";;", $ref/description)]]> 233 </ndg:xquery> 234 </ndg:addComment> 226 concat(//CIMRecord/simulationRun/documentID, "_", $ref/name, ";;", $ref/description)]]> 227 </xquery> 228 </ndg:Action> 229 235 230 236 231 <!-- SIMULATION_RUN.literals --> 237 <ndg: addTripleLiteral>238 <ndg: ontSubject>239 http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance240 </ndg:ontSubject>241 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentalConformanceNote"/>242 < ndg:xquery>232 <ndg:Action> 233 <ndg:addTripleLiteral> 234 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance"/> 235 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentalConformanceNote"/> 236 </ndg:addTripleLiteral> 237 <xquery> 243 238 <![CDATA[ 244 239 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 245 240 for $conf in //CIMRecord/simulationRun/conformance, 246 $ name in $conf/requirement/reference/name241 $reference in $conf/requirement/reference 247 242 return 248 concat( $name, ";;", $conf/source/reference/description)]]>249 </ ndg:xquery>250 </ndg: addTripleLiteral>243 concat(//CIMRecord/simulationRun/documentID, "_", $reference/name, ";;", $reference/description)]]> 244 </xquery> 245 </ndg:Action> 251 246 252 247 253 248 <!-- MODEL_COMPONENT --> 254 249 <!-- MODEL_COMPONENT.labels --> 255 <!-- model & childmodel--> 256 <ndg:addLabel> 257 <ndg:ontSubject> 258 http://www.earthsystemgrid.org/esg.owl#Model 259 </ndg:ontSubject> 260 <ndg:xquery> 250 <ndg:Action> 251 <ndg:addLabel> 252 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 253 </ndg:addLabel> 254 <xquery> 255 <![CDATA[ 256 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 257 for $comp in //CIMRecord//modelComponent 258 let $coups := for $coup in $comp/composition//coupling 259 let $ types := for $type in $coup/couplingSource/reference/type 260 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 261 return 262 concat($comp/documentID, "_", $type, "_", $var, ";;", $var) 263 return $vars 264 return $types 265 return $coups]]> 266 </xquery> 267 </ndg:Action> 268 269 <!-- model & childmodel--> 270 <ndg:Action> 271 <ndg:addLabel> 272 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 273 </ndg:addLabel> 274 <xquery> 261 275 <![CDATA[ 262 276 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 264 278 let $res := for $item in $comp/modelComponent | $comp/modelComponent/childComponent/modelComponent 265 279 return 266 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/shortName, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName)280 concat($item/documentID, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/documentID, ";;", $item/shortName, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName) 267 281 return $res 268 ]]> 269 </ndg:xquery> 270 </ndg:addLabel> 282 ]]> 283 </xquery> 284 </ndg:Action> 285 271 286 <!-- child's model component--> 272 <ndg: addLabel>273 <ndg: ontSubject>274 http://www.earthsystemgrid.org/esg.owl#ModelComponent275 </ndg: ontSubject>276 < ndg:xquery>287 <ndg:Action> 288 <ndg:addLabel> 289 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 290 </ndg:addLabel> 291 <xquery> 277 292 <![CDATA[ 278 293 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 280 295 for $sn in $rt//childComponent/modelComponent/shortName 281 296 return 282 concat($sn, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $sn, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName) 283 ]]> 284 </ndg:xquery> 285 </ndg:addLabel> 297 concat($sn/documentID, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/documentID, ";;", $sn/shortName, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName) 298 ]]> 299 </xquery> 300 </ndg:Action> 301 286 302 287 303 <!-- model & childmodel & child's model --> 288 <ndg: addLabel>289 <ndg: ontSubject>290 http://www.earthsystemgrid.org/esg.owl#Agency291 </ndg: ontSubject>292 < ndg:xquery>304 <ndg:Action> 305 <ndg:addLabel> 306 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Agency"/> 307 </ndg:addLabel> 308 <xquery> 293 309 <![CDATA[ 294 310 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 309 325 return $roles 310 326 return $res 311 return $nodes]]> 312 </ndg:xquery> 313 </ndg:addLabel> 314 315 327 return $nodes]]> 328 </xquery> 329 </ndg:Action> 316 330 317 331 <!-- MODEL_COMPONENT.comment --> 332 <ndg:Action> 333 <ndg:addComment> 334 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 335 </ndg:addComment> 336 <xquery> 337 <![CDATA[ 338 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 339 for $comp in //CIMRecord//modelComponent 340 let $coups := for $coup in $comp/composition//coupling 341 let $ types := for $type in $coup/couplingSource/reference/type 342 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 343 return 344 concat($comp/documentID, "_", $type, "_", $var, ";;", $comp/description) 345 return $vars 346 return $types 347 return $coups]]> 348 </xquery> 349 </ndg:Action> 350 351 318 352 <!-- model & childmodel --> 319 <ndg: addComment>320 <ndg: ontSubject>321 http://www.earthsystemgrid.org/esg.owl#Model322 </ndg: ontSubject>323 < ndg:xquery>353 <ndg:Action> 354 <ndg:addComment> 355 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 356 </ndg:addComment> 357 <xquery> 324 358 <![CDATA[ 325 359 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 327 361 let $res := for $item in $comp/modelComponent | $comp/modelComponent/childComponent/modelComponent 328 362 return 329 concat($item/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/description) 330 return $res ]]> 331 </ndg:xquery> 332 </ndg:addComment> 363 concat($item/documentID, ";;", 364 if (string-length($item/description) > 0) then $item/description else "No description") 365 return $res ]]> 366 </xquery> 367 </ndg:Action> 368 333 369 <!-- child's model component--> 334 <ndg: addComment>335 <ndg: ontSubject>336 http://www.earthsystemgrid.org/esg.owl#ModelComponent337 </ndg: ontSubject>338 < ndg:xquery>370 <ndg:Action> 371 <ndg:addComment> 372 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 373 </ndg:addComment> 374 <xquery> 339 375 <![CDATA[ 340 376 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 341 377 for $rt in //CIMRecord/modelComponent/childComponent/modelComponent 342 378 for $comp in $rt//childComponent/modelComponent 343 return 344 concat($comp/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $comp/description)]]>345 </ndg:xquery> 346 </ndg:addComment>347 379 return 380 concat($comp/documentID, ";;", 381 if (string-length($comp/description) > 0) then $comp/description else "No description")]]> 382 </xquery> 383 </ndg:Action> 348 384 349 385 <!-- MODEL_COMPONENT.literals --> 386 <ndg:Action> 387 <ndg:addTripleLiteral> 388 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 389 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputFrequency"/> 390 </ndg:addTripleLiteral> 391 <xquery> 392 <![CDATA[ 393 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 394 for $comp in //CIMRecord//modelComponent 395 let $coups := for $coup in $comp/composition//coupling 396 let $ types := for $type in $coup/couplingSource/reference/type 397 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 398 return 399 concat($comp/documentID, "_", $type, "_", $var, ";;", $coup/timeProfile/rate, " ", $coup/timeProfile/@units) 400 return $vars 401 return $types 402 return $coups]]> 403 </xquery> 404 </ndg:Action> 405 350 406 <!-- model and childmodel --> 351 <ndg: addTripleLiteral>352 <ndg: ontSubject>353 http://www.earthsystemgrid.org/esg.owl#Model354 </ndg:ontSubject>355 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFullName"/>356 < ndg:xquery>407 <ndg:Action> 408 <ndg:addTripleLiteral> 409 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 410 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFullName"/> 411 </ndg:addTripleLiteral> 412 <xquery> 357 413 <![CDATA[ 358 414 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 360 416 let $res := for $item in $comp/modelComponent | $comp/modelComponent/childComponent/modelComponent 361 417 return 362 concat($item/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/longName) 363 return $res]]> 364 </ndg:xquery> 365 </ndg:addTripleLiteral> 418 concat($item/documentID, ";;", 419 if (string-length($item/longName) > 0) then $item/longName else "No longName") 420 return $res]]> 421 </xquery> 422 </ndg:Action> 366 423 <!-- child's model component--> 367 <ndg: addTripleLiteral>368 <ndg: ontSubject>369 http://www.earthsystemgrid.org/esg.owl#ModelComponent370 </ndg:ontSubject>371 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFullName"/>372 < ndg:xquery>424 <ndg:Action> 425 <ndg:addTripleLiteral> 426 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 427 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFullName"/> 428 </ndg:addTripleLiteral> 429 <xquery> 373 430 <![CDATA[ 374 431 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 376 433 for $comp in $rt//childComponent/modelComponent 377 434 return 378 concat($comp/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $comp/longName)]]> 379 </ndg:xquery> 380 </ndg:addTripleLiteral> 435 concat($comp/documentID, ";;", 436 if (string-length($comp/longName) > 0) then $comp/longName else "No longName")]]> 437 </xquery> 438 </ndg:Action> 381 439 382 440 <!-- model & childmodel & child's model --> 383 <ndg: addTripleLiteral>384 <ndg: ontSubject>385 http://www.earthsystemgrid.org/esg.owl#Contact386 </ndg:ontSubject>387 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasContactName"/>388 < ndg:xquery>441 <ndg:Action> 442 <ndg:addTripleLiteral> 443 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Contact"/> 444 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasContactName"/> 445 </ndg:addTripleLiteral> 446 <xquery> 389 447 <![CDATA[ 390 448 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 403 461 return $roles 404 462 return $res 405 return $nodes]]> 406 </ ndg:xquery>407 </ndg: addTripleLiteral>463 return $nodes]]> 464 </xquery> 465 </ndg:Action> 408 466 409 467 <!-- model & childmodel & child's model --> 410 <ndg: addTripleLiteral>411 <ndg: ontSubject>412 http://www.earthsystemgrid.org/esg.owl#Contact413 </ndg:ontSubject>414 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasEmail"/>415 < ndg:xquery>468 <ndg:Action> 469 <ndg:addTripleLiteral> 470 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Contact"/> 471 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasEmail"/> 472 </ndg:addTripleLiteral> 473 <xquery> 416 474 <![CDATA[ 417 475 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 430 488 return $roles 431 489 return $res 432 return $nodes]]> 433 </ ndg:xquery>434 </ndg: addTripleLiteral>490 return $nodes]]> 491 </xquery> 492 </ndg:Action> 435 493 436 494 <!-- model and childmodel --> 437 <ndg: addTripleLiteral>438 <ndg: ontSubject>439 http://www.earthsystemgrid.org/esg.owl#Model440 </ndg:ontSubject>441 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInstitution"/>442 < ndg:xquery>495 <ndg:Action> 496 <ndg:addTripleLiteral> 497 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 498 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInstitution"/> 499 </ndg:addTripleLiteral> 500 <xquery> 443 501 <![CDATA[ 444 502 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 451 509 return 452 510 if ($role = 'centre') 453 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)511 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 454 512 else empty 455 513 return $roles 456 514 return $res 457 return $nodes]]> 458 </ndg:xquery> 459 </ndg:addTripleLiteral> 515 return $nodes]]> 516 </xquery> 517 </ndg:Action> 518 460 519 <!-- child's model component--> 461 <ndg: addTripleLiteral>462 <ndg: ontSubject>463 http://www.earthsystemgrid.org/esg.owl#ModelComponent464 </ndg:ontSubject>465 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInstitution"/>466 < ndg:xquery>520 <ndg:Action> 521 <ndg:addTripleLiteral> 522 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 523 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInstitution"/> 524 </ndg:addTripleLiteral> 525 <xquery> 467 526 <![CDATA[ 468 527 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 475 534 return 476 535 if ($role = 'centre') 477 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)536 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 478 537 else empty 479 538 return $roles 480 539 return $res 481 return $nodes]]> 482 </ ndg:xquery>483 </ndg: addTripleLiteral>540 return $nodes]]> 541 </xquery> 542 </ndg:Action> 484 543 485 544 486 545 <!-- model and childmodel --> 487 <ndg: addTripleLiteral>488 <ndg: ontSubject>489 http://www.earthsystemgrid.org/esg.owl#Model490 </ndg:ontSubject>491 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasReference"/>492 < ndg:xquery>546 <ndg:Action> 547 <ndg:addTripleLiteral> 548 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 549 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasReference"/> 550 </ndg:addTripleLiteral> 551 <xquery> 493 552 <![CDATA[ 494 553 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 499 558 let $res := for $item in $res/citation 500 559 return 501 concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;",560 concat($res/documentID, ";;", 502 561 $item/gmd:CI_Citation/gmd:collectiveTitle/gco:CharacterString, " ", $item/gmd:CI_Citation/gmd:citationDetails/gco:CharacterString) 503 562 return $res 504 return $nodes]]> 505 </ ndg:xquery>506 </ndg: addTripleLiteral>563 return $nodes]]> 564 </xquery> 565 </ndg:Action> 507 566 508 567 509 568 <!-- child's model component--> 510 <ndg: addTripleLiteral>511 <ndg: ontSubject>512 http://www.earthsystemgrid.org/esg.owl#ModelComponent513 </ndg:ontSubject>514 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasReference"/>515 < ndg:xquery>569 <ndg:Action> 570 <ndg:addTripleLiteral> 571 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 572 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasReference"/> 573 </ndg:addTripleLiteral> 574 <xquery> 516 575 <![CDATA[ 517 576 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 522 581 let $res := for $item in $res//citation 523 582 return 524 concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:CI_Citation/gmd:collectiveTitle/gco:CharacterString, " ", $item/gmd:CI_Citation/gmd:citationDetails/gco:CharacterString)583 concat($res/documentID, ";;", $item/gmd:CI_Citation/gmd:collectiveTitle/gco:CharacterString, " ", $item/gmd:CI_Citation/gmd:citationDetails/gco:CharacterString) 525 584 return $res 526 return $nodes]]> 527 </ndg:xquery> 528 </ndg:addTripleLiteral> 529 585 return $nodes]]> 586 </xquery> 587 </ndg:Action> 530 588 531 589 532 590 533 591 <!-- MODEL_COMPONENT.triples --> 534 <ndg:addTriple> 535 <ndg:ontSubject> 536 http://www.earthsystemgrid.org/esg.owl#Model 537 </ndg:ontSubject> 538 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasComputingEnvironment"/> 539 <ndg:ontObject> 540 http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment 541 </ndg:ontObject> 542 <ndg:xquery> 592 <ndg:Action> 593 <ndg:addTriple> 594 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 595 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputType"/> 596 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InputType"/> 597 </ndg:addTriple> 598 <xquery> 599 <![CDATA[ 600 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 601 declare namespace xs = "http://www.w3.org/2001/XMLSchema"; 602 declare namespace ndg = "http://www.ndg.ac.uk"; 603 declare variable $metaforMapping external; 604 declare function ndg:getValueFromMap 605 ($node as node()*, $arg as xs:string) as xs:string* { 606 let $ret := for $el in $node 607 return 608 if (data($el/@metaforName) = $arg) 609 then data($el/@esgName) 610 else data(()) 611 return 612 if (count($ret) > 0) 613 then $ret[1] 614 else data(()) 615 }; 616 617 for $comp in //CIMRecord//modelComponent 618 let $coups := for $coup in $comp/composition//coupling 619 let $ types := for $type in $coup/couplingSource/reference/type 620 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 621 return 622 concat($comp/documentID, "_", $type, "_", $var, ";;", ndg:getValueFromMap($metaforMapping//ndg:entry, $coup/@purpose)) 623 return $vars 624 return $types 625 return $coups]]> 626 </xquery> 627 </ndg:Action> 628 629 <ndg:Action> 630 <ndg:addTriple> 631 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 632 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputCondition"/> 633 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 634 </ndg:addTriple> 635 <xquery> 636 <![CDATA[ 637 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 638 for $comp in //CIMRecord/modelComponent | //CIMRecord/modelComponent/childComponent/modelComponent 639 let $coups := for $coup in $comp/composition//coupling 640 let $ types := for $type in $coup/couplingSource/reference/type 641 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 642 return 643 concat($comp/documentID, ";;", $comp/documentID, "_", $type, "_", $var) 644 return $vars 645 return $types 646 return $coups]]> 647 </xquery> 648 </ndg:Action> 649 650 <ndg:Action> 651 <ndg:addTriple> 652 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 653 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputSpatialRegriddingMethod"/> 654 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InputSpatialRegriddingMethod"/> 655 </ndg:addTriple> 656 <xquery> 657 <![CDATA[ 658 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 659 for $comp in //CIMRecord//modelComponent 660 let $coups := for $coup in $comp/composition//coupling 661 let $ types := for $type in $coup/couplingSource/reference/type 662 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 663 return 664 if ($coup/spatialRegridding/@conservativeSpatialRegridding = "true") 665 then concat($comp/documentID, "_", $type, "_", $var, ";;", "conservative") 666 else if ($coup/spatialRegridding/@conservativeSpatialRegridding = "false") 667 then concat($comp/documentID, "_", $type, "_", $var, ";;", "non-conservative") 668 else concat($comp/documentID, "_", $type, "_", $var, ";;", empty) 669 return $vars 670 return $types 671 return $coups]]> 672 </xquery> 673 </ndg:Action> 674 675 676 <ndg:Action> 677 <ndg:addTripleLiteral> 678 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 679 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputSourceDataset"/> 680 </ndg:addTripleLiteral> 681 <xquery> 682 <![CDATA[ 683 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 684 for $comp in //CIMRecord//modelComponent 685 let $coups := for $coup in $comp/composition//coupling 686 let $ refs := for $ref in $coup/couplingSource/reference 687 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 688 where ($ref/type = "dataObject") 689 return 690 concat($comp/documentID, "_", $ref/type, "_", $var, ";;", $ref/id) 691 return $vars 692 return $refs 693 return $coups]]> 694 </xquery> 695 </ndg:Action> 696 697 <!-- model and childmodel --> 698 <ndg:Action> 699 <ndg:addTriple> 700 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 701 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputSourceComponent"/> 702 <ndg:ontObject dynamic="true"/> 703 </ndg:addTriple> 704 <xquery> 705 <![CDATA[ 706 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 707 let $nodes := //CIMRecord/modelComponent | //CIMRecord/modelComponent/childComponent/modelComponent 708 for $comp in //CIMRecord//modelComponent 709 let $coups := for $coup in $comp/composition//coupling 710 let $refs := for $ref in $coup/couplingSource/reference 711 let $vars := for $var in $coup/connection/connectionTarget/reference/name 712 where ($ref/type = "modelComponent") 713 return 714 for $md in $nodes 715 return 716 if ($md/documentID = $ref/id) 717 then 718 concat($comp/documentID, "_", $ref/type, "_", $var, ";;", $ref/id, ";;", "http://www.earthsystemgrid.org/esg.owl#Model") 719 else "" 720 return $vars 721 return $refs 722 return $coups]]> 723 </xquery> 724 </ndg:Action> 725 <!-- child's model component--> 726 <ndg:Action> 727 <ndg:addTriple> 728 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 729 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputSourceComponent"/> 730 <ndg:ontObject dynamic="true"/> 731 </ndg:addTriple> 732 <xquery> 733 <![CDATA[ 734 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 735 let $nodes := //CIMRecord/modelComponent/childComponent/modelComponent//childComponent/modelComponent 736 for $comp in //CIMRecord//modelComponent 737 let $coups := for $coup in $comp/composition//coupling 738 let $refs := for $ref in $coup/couplingSource/reference 739 let $vars := for $var in $coup/connection/connectionTarget/reference/name 740 where ($ref/type = "modelComponent") 741 return 742 for $md in $nodes 743 return 744 if ($md/documentID = $ref/id) 745 then 746 concat($comp/documentID, "_", $ref/type, "_", $var, ";;", $ref/id, ";;", "http://www.earthsystemgrid.org/esg.owl#ModelComponent") 747 else "" 748 return $vars 749 return $refs 750 return $coups]]> 751 </xquery> 752 </ndg:Action> 753 754 <ndg:Action> 755 <ndg:addTriple> 756 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 757 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputTimeTransformationType"/> 758 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InputTimeTransformationType"/> 759 </ndg:addTriple> 760 <xquery> 761 <![CDATA[ 762 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 763 declare namespace xs = "http://www.w3.org/2001/XMLSchema"; 764 declare namespace ndg = "http://www.ndg.ac.uk"; 765 declare variable $metaforMapping external; 766 declare function ndg:getValueFromMap 767 ($node as node()*, $arg as xs:string) as xs:string* { 768 let $ret := for $el in $node 769 return 770 if (data($el/@metaforName) = $arg) 771 then data($el/@esgName) 772 else data(()) 773 return 774 if (count($ret) > 0) 775 then $ret[1] 776 else data(()) 777 }; 778 779 for $comp in //CIMRecord//modelComponent 780 let $coups := for $coup in $comp/composition//coupling 781 let $ types := for $type in $coup/couplingSource/reference/type 782 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 783 return 784 if (exists(ndg:getValueFromMap($metaforMapping//ndg:entry, $coup/timeTransformation/mappingType/@value))) 785 then concat($comp/documentID, "_", $type, "_", $var, ";;", ndg:getValueFromMap($metaforMapping//ndg:entry, $coup/timeTransformation/mappingType/@value)) 786 else concat($comp/documentID, "_", $type, "_", $var, ";;", $coup/timeTransformation/mappingType/@value) 787 return $vars 788 return $types 789 return $coups]]> 790 </xquery> 791 </ndg:Action> 792 793 <!-- child's model component--> 794 <ndg:Action> 795 <ndg:addTriple> 796 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 797 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasInputCondition"/> 798 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#InputCondition"/> 799 </ndg:addTriple> 800 <xquery> 801 <![CDATA[ 802 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 803 for $rt in //CIMRecord/modelComponent/childComponent/modelComponent 804 for $comp in $rt//childComponent/modelComponent 805 let $coups := for $coup in $comp/composition//coupling 806 let $ types := for $type in $coup/couplingSource/reference/type 807 let $ vars := for $var in $coup/connection/connectionTarget/reference/name 808 return 809 concat($comp/documentID, ";;", $comp/documentID, "_", $type, "_", $var) 810 return $vars 811 return $types 812 return $coups]]> 813 </xquery> 814 </ndg:Action> 815 816 <ndg:Action> 817 <ndg:addTriple> 818 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 819 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasComputingEnvironment"/> 820 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#ComputingEnvironment"/> 821 </ndg:addTriple> 822 <xquery> 543 823 <![CDATA[ 544 824 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 549 829 $compVer in $plat/compiler/compilerVersion 550 830 return 551 concat(CIMRecordSet/CIMRecord/CIMRecord/modelComponent/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $mac/machineName, "_",831 concat(CIMRecordSet/CIMRecord/CIMRecord/modelComponent/documentID, ";;", $mac/machineName, "_", 552 832 $mac/machineVendor, "_", 553 833 $compName, "_", 554 $compVer)]]> 555 </ndg:xquery> 556 </ndg:addTriple> 557 558 <ndg:addTriple> 559 <ndg:ontSubject> 560 http://www.earthsystemgrid.org/esg.owl#Model 561 </ndg:ontSubject> 562 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentalConformance"/> 563 <ndg:ontObject> 564 http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance 565 </ndg:ontObject> 566 <ndg:xquery> 834 $compVer)]]> 835 </xquery> 836 </ndg:Action> 837 838 <ndg:Action> 839 <ndg:addTriple> 840 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 841 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasExperimentalConformance"/> 842 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#ExperimentalConformance"/> 843 </ndg:addTriple> 844 <xquery> 567 845 <![CDATA[ 568 846 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 574 852 for $confName in //CIMRecord/simulationRun/conformance 575 853 return 576 concat(CIMRecordSet/CIMRecord/CIMRecord/modelComponent/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $confName/requirement/reference/name)]]> 577 </ndg:xquery> 578 </ndg:addTriple> 854 concat(CIMRecordSet/CIMRecord/CIMRecord/modelComponent/documentID, ";;", $confName/requirement/reference/name)]]> 855 </xquery> 856 </ndg:Action> 857 858 579 859 580 860 581 861 <!-- model and childmodel --> 582 <ndg:addTriple> 583 <ndg:ontSubject> 584 http://www.earthsystemgrid.org/esg.owl#Model 585 </ndg:ontSubject> 586 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPhysicalDomain"/> 587 <ndg:ontObject> 588 http://www.earthsystemgrid.org/esg.owl#PhysicalDomain 589 </ndg:ontObject> 590 <ndg:xquery> 862 <ndg:Action> 863 <ndg:addTriple> 864 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 865 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPhysicalDomain"/> 866 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#PhysicalDomain"/> 867 </ndg:addTriple> 868 <xquery> 591 869 <![CDATA[ 592 870 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 597 875 return 598 876 if ($type = 'AtmosphericChemistry' or $type = 'atmosphere' or $type = 'Atmosphere' or $type = 'Aerosols') 599 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Atmosphere')877 then concat($item/documentID, ";;", 'Atmosphere') 600 878 else if ($type = 'LandIce') 601 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Ice')879 then concat($item/documentID, ";;", 'Ice') 602 880 else if ($type = 'LandSurface') 603 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Land')881 then concat($item/documentID, ";;", 'Land') 604 882 else if ($type = 'ocean' or $type = 'OceanBiogeoChemistry') 605 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Ocean')883 then concat($item/documentID, ";;", 'Ocean') 606 884 else empty 607 885 return $types 608 return $res]]> 609 </ndg:xquery> 610 </ndg:addTriple> 886 return $res]]> 887 </xquery> 888 </ndg:Action> 889 611 890 <!-- child's model component--> 612 <ndg:addTriple> 613 <ndg:ontSubject> 614 http://www.earthsystemgrid.org/esg.owl#ModelComponent 615 </ndg:ontSubject> 616 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPhysicalDomain"/> 617 <ndg:ontObject> 618 http://www.earthsystemgrid.org/esg.owl#PhysicalDomain 619 </ndg:ontObject> 620 <ndg:xquery> 891 <ndg:Action> 892 <ndg:addTriple> 893 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 894 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPhysicalDomain"/> 895 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#PhysicalDomain"/> 896 </ndg:addTriple> 897 <xquery> 621 898 <![CDATA[ 622 899 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 627 904 return 628 905 if ($type = 'AtmosphericChemistry' or $type = 'atmosphere' or $type = 'Atmosphere' or $type = 'Aerosols') 629 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Atmosphere')906 then concat($item/documentID, ";;", 'Atmosphere') 630 907 else if ($type = 'LandIce') 631 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Ice')908 then concat($item/documentID, ";;", 'Ice') 632 909 else if ($type = 'LandSurface') 633 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Land')910 then concat($item/documentID, ";;", 'Land') 634 911 else if ($type = 'ocean' or $type = 'OceanBiogeoChemistry') 635 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'Ocean')912 then concat($item/documentID, ";;", 'Ocean') 636 913 else empty 637 914 return $types 638 return $res]]> 639 </ ndg:xquery>640 </ndg: addTriple>915 return $res]]> 916 </xquery> 917 </ndg:Action> 641 918 642 919 643 920 <!-- model and childmodel --> 644 <ndg:addTriple> 645 <ndg:ontSubject> 646 http://www.earthsystemgrid.org/esg.owl#Model 647 </ndg:ontSubject> 648 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasTopic"/> 649 <ndg:ontObject> 650 http://www.earthsystemgrid.org/esg.owl#Topic 651 </ndg:ontObject> 652 <ndg:xquery> 653 <![CDATA[ 921 <ndg:Action> 922 <ndg:addTriple> 923 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 924 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasTopic"/> 925 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Topic"/> 926 </ndg:addTriple> 927 <xquery> 928 <![CDATA[ 654 929 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 655 930 for $comp in //CIMRecord … … 659 934 return 660 935 if ($type = 'AtmosphericChemistry' or $type = 'atmosphere' or $type = 'Atmosphere') 661 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'atmos')936 then concat($item/documentID, ";;", 'atmos') 662 937 else if ($type = 'LandIce') 663 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'landice')938 then concat($item/documentID, ";;", 'landice') 664 939 else if ($type = 'LandSurface') 665 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'land')940 then concat($item/documentID, ";;", 'land') 666 941 else if ($type = 'ocean') 667 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'ocean')942 then concat($item/documentID, ";;", 'ocean') 668 943 else empty 669 944 return $types 670 return $res]]> 671 </ndg:xquery> 672 </ndg:addTriple> 945 return $res]]> 946 </xquery> 947 </ndg:Action> 948 673 949 <!-- child's model component--> 674 <ndg:addTriple> 675 <ndg:ontSubject> 676 http://www.earthsystemgrid.org/esg.owl#ModelComponent 677 </ndg:ontSubject> 678 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasTopic"/> 679 <ndg:ontObject> 680 http://www.earthsystemgrid.org/esg.owl#Topic 681 </ndg:ontObject> 682 <ndg:xquery> 950 <ndg:Action> 951 <ndg:addTriple> 952 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 953 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasTopic"/> 954 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Topic"/> 955 </ndg:addTriple> 956 <xquery> 683 957 <![CDATA[ 684 958 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 689 963 return 690 964 if ($type = 'AtmosphericChemistry' or $type = 'atmosphere' or $type = 'Atmosphere') 691 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'atmos')965 then concat($item/documentID, ";;", 'atmos') 692 966 else if ($type = 'LandIce') 693 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'landice')967 then concat($item/documentID, ";;", 'landice') 694 968 else if ($type = 'LandSurface') 695 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'land')969 then concat($item/documentID, ";;", 'land') 696 970 else if ($type = 'ocean') 697 then concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", 'ocean')971 then concat($item/documentID, ";;", 'ocean') 698 972 else empty 699 973 return $types 700 974 return $res]]> 701 </ndg:xquery> 702 </ndg:addTriple> 703 975 </xquery> 976 </ndg:Action> 977 978 704 979 <!-- model --> 705 <ndg:addTriple> 706 <ndg:ontSubject> 707 http://www.earthsystemgrid.org/esg.owl#Model 708 </ndg:ontSubject> 709 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasChildModelComponent"/> 710 <ndg:ontObject> 711 http://www.earthsystemgrid.org/esg.owl#Model 712 </ndg:ontObject> 713 <ndg:xquery> 980 <ndg:Action> 981 <ndg:addTriple> 982 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 983 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasChildModelComponent"/> 984 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 985 </ndg:addTriple> 986 <xquery> 714 987 <![CDATA[ 715 988 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 718 991 let $res := for $item in $nodes 719 992 return 720 concat(CIMRecordSet/CIMRecord/CIMRecord/modelComponent/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName)993 concat(CIMRecordSet/CIMRecord/CIMRecord/modelComponent/documentID, ";;", $item/documentID) 721 994 return $res]]> 722 </ndg:xquery> 723 </ndg:addTriple> 995 </xquery> 996 </ndg:Action> 997 998 724 999 <!-- child model --> 725 <ndg:addTriple> 726 <ndg:ontSubject> 727 http://www.earthsystemgrid.org/esg.owl#Model 728 </ndg:ontSubject> 729 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasChildModelComponent"/> 730 <ndg:ontObject> 731 http://www.earthsystemgrid.org/esg.owl#ModelComponent 732 </ndg:ontObject> 733 <ndg:xquery> 1000 <ndg:Action> 1001 <ndg:addTriple> 1002 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1003 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasChildModelComponent"/> 1004 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1005 </ndg:addTriple> 1006 <xquery> 734 1007 <![CDATA[ 735 1008 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 737 1010 let $res := for $item in $comp/childComponent/modelComponent 738 1011 return 739 concat($comp/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName)1012 concat($comp/documentID, ";;", $item/documentID) 740 1013 return $res]]> 741 </ndg:xquery> 742 </ndg:addTriple> 1014 </xquery> 1015 </ndg:Action> 1016 1017 1018 743 1019 <!-- child's model component--> 744 <ndg:addTriple> 745 <ndg:ontSubject> 746 http://www.earthsystemgrid.org/esg.owl#ModelComponent 747 </ndg:ontSubject> 748 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasChildModelComponent"/> 749 <ndg:ontObject> 750 http://www.earthsystemgrid.org/esg.owl#ModelComponent 751 </ndg:ontObject> 752 <ndg:xquery> 1020 <ndg:Action> 1021 <ndg:addTriple> 1022 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1023 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasChildModelComponent"/> 1024 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1025 </ndg:addTriple> 1026 <xquery> 753 1027 <![CDATA[ 754 1028 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 757 1031 let $res := for $item in $nodes 758 1032 return 759 concat($comp/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/shortName, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName)1033 concat($comp/documentID, ";;", $item/documentID) 760 1034 return $res]]> 761 </ ndg:xquery>762 </ndg: addTriple>1035 </xquery> 1036 </ndg:Action> 763 1037 764 1038 <!-- model and childmodel --> 765 <ndg:addTriple> 766 <ndg:ontSubject> 767 http://www.earthsystemgrid.org/esg.owl#Model 768 </ndg:ontSubject> 769 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFundingSource"/> 770 <ndg:ontObject> 771 http://www.earthsystemgrid.org/esg.owl#Agency 772 </ndg:ontObject> 773 <ndg:xquery> 1039 <ndg:Action> 1040 <ndg:addTriple> 1041 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1042 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFundingSource"/> 1043 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Agency"/> 1044 </ndg:addTriple> 1045 <xquery> 774 1046 <![CDATA[ 775 1047 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 783 1055 if ($role = 'funder') 784 1056 then if (exists($item/gmd:organizationName/gco:CharacterString)) 785 then concat($res/ shortName, ";;", $item/gmd:organizationName/gco:CharacterString)1057 then concat($res/documentID, ";;", $item/gmd:organizationName/gco:CharacterString) 786 1058 else if (exists($item/gmd:individualName/gco:CharacterString)) 787 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)1059 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 788 1060 else empty 789 1061 else empty … … 791 1063 return $res 792 1064 return $nodes]]> 793 </ ndg:xquery>794 </ndg: addTriple>1065 </xquery> 1066 </ndg:Action> 795 1067 796 1068 <!-- model and childmodel --> 797 <ndg:addTriple> 798 <ndg:ontSubject> 799 http://www.earthsystemgrid.org/esg.owl#ModelComponent 800 </ndg:ontSubject> 801 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFundingSource"/> 802 <ndg:ontObject> 803 http://www.earthsystemgrid.org/esg.owl#Agency 804 </ndg:ontObject> 805 <ndg:xquery> 1069 <ndg:Action> 1070 <ndg:addTriple> 1071 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1072 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasFundingSource"/> 1073 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Agency"/> 1074 </ndg:addTriple> 1075 <xquery> 806 1076 <![CDATA[ 807 1077 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 815 1085 if ($role = 'funder') 816 1086 then if (exists($item/gmd:organizationName/gco:CharacterString)) 817 then concat($res/ shortName, ";;", $item/gmd:organizationName/gco:CharacterString)1087 then concat($res/documentID, ";;", $item/gmd:organizationName/gco:CharacterString) 818 1088 else if (exists($item/gmd:individualName/gco:CharacterString)) 819 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)1089 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 820 1090 else empty 821 1091 else empty … … 823 1093 return $res 824 1094 return $nodes]]> 825 </ndg:xquery> 826 </ndg:addTriple> 1095 </xquery> 1096 </ndg:Action> 1097 827 1098 828 1099 <!-- model and childmodel --> 829 <ndg:addTriple> 830 <ndg:ontSubject> 831 http://www.earthsystemgrid.org/esg.owl#Model 832 </ndg:ontSubject> 833 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasContactObject"/> 834 <ndg:ontObject> 835 http://www.earthsystemgrid.org/esg.owl#Contact 836 </ndg:ontObject> 837 <ndg:xquery> 1100 <ndg:Action> 1101 <ndg:addTriple> 1102 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1103 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasContactObject"/> 1104 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Contact"/> 1105 </ndg:addTriple> 1106 <xquery> 838 1107 <![CDATA[ 839 1108 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 846 1115 return 847 1116 if ($role = 'contact') 848 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)1117 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 849 1118 else empty 850 1119 return $roles 851 1120 return $res 852 1121 return $nodes]]> 853 </ ndg:xquery>854 </ndg: addTriple>1122 </xquery> 1123 </ndg:Action> 855 1124 856 1125 <!-- model and childmodel --> 857 <ndg:addTriple> 858 <ndg:ontSubject> 859 http://www.earthsystemgrid.org/esg.owl#ModelComponent 860 </ndg:ontSubject> 861 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasContactObject"/> 862 <ndg:ontObject> 863 http://www.earthsystemgrid.org/esg.owl#Contact 864 </ndg:ontObject> 865 <ndg:xquery> 1126 <ndg:Action> 1127 <ndg:addTriple> 1128 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1129 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasContactObject"/> 1130 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Contact"/> 1131 </ndg:addTriple> 1132 <xquery> 866 1133 <![CDATA[ 867 1134 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 874 1141 return 875 1142 if ($role = 'contact') 876 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)1143 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 877 1144 else empty 878 1145 return $roles 879 1146 return $res 880 1147 return $nodes]]> 881 </ ndg:xquery>882 </ndg: addTriple>1148 </xquery> 1149 </ndg:Action> 883 1150 884 1151 <!-- model and childmodel --> 885 <ndg:addTriple> 886 <ndg:ontSubject> 887 http://www.earthsystemgrid.org/esg.owl#Model 888 </ndg:ontSubject> 889 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPI"/> 890 <ndg:ontObject> 891 http://www.earthsystemgrid.org/esg.owl#Contact 892 </ndg:ontObject> 893 <ndg:xquery> 1152 <ndg:Action> 1153 <ndg:addTriple> 1154 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1155 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPI"/> 1156 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Contact"/> 1157 </ndg:addTriple> 1158 <xquery> 894 1159 <![CDATA[ 895 1160 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 902 1167 return 903 1168 if ($role = 'author' or $role = 'PI') 904 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)1169 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 905 1170 else empty 906 1171 return $roles 907 1172 return $res 908 1173 return $nodes]]> 909 </ndg:xquery> 910 </ndg:addTriple> 911 1174 </xquery> 1175 </ndg:Action> 912 1176 913 1177 <!-- model and childmodel --> 914 <ndg:addTriple> 915 <ndg:ontSubject> 916 http://www.earthsystemgrid.org/esg.owl#ModelComponent 917 </ndg:ontSubject> 918 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPI"/> 919 <ndg:ontObject> 920 http://www.earthsystemgrid.org/esg.owl#Contact 921 </ndg:ontObject> 922 <ndg:xquery> 1178 <ndg:Action> 1179 <ndg:addTriple> 1180 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1181 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPI"/> 1182 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#Contact"/> 1183 </ndg:addTriple> 1184 <xquery> 923 1185 <![CDATA[ 924 1186 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 931 1193 return 932 1194 if ($role = 'author' or $role = 'PI') 933 then concat($res/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/gmd:individualName/gco:CharacterString)1195 then concat($res/documentID, ";;", $item/gmd:individualName/gco:CharacterString) 934 1196 else empty 935 1197 return $roles 936 1198 return $res 937 1199 return $nodes]]> 938 </ ndg:xquery>939 </ndg: addTriple>1200 </xquery> 1201 </ndg:Action> 940 1202 941 1203 <!-- model and childmodel --> 942 <ndg: addTripleLiteral>943 <ndg: ontSubject>944 http://www.earthsystemgrid.org/esg.owl#Model945 </ndg:ontSubject>946 < ndg:ontPredicate dynamic="true"/>947 < ndg:xquery>1204 <ndg:Action> 1205 <ndg:addTripleLiteral> 1206 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1207 <ndg:ontPredicate dynamic="true"/> 1208 </ndg:addTripleLiteral> 1209 <xquery> 948 1210 <![CDATA[ 949 1211 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 975 1237 let $props := for $prop in $item/componentProperties/componentProperty 976 1238 return 977 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", string-join(data($prop/value), ','), ";;", ndg:mapProperty($lookup//ndg:entry, concat($type, $prop/shortName)))1239 concat($item/documentID, ";;", string-join(data($prop/value), ','), ";;", ndg:mapProperty($lookup//ndg:entry, concat($type, $prop/shortName))) 978 1240 return $props 979 1241 return $types 980 return $res]]> 981 </ ndg:xquery>982 </ndg: addTripleLiteral>1242 return $res]]> 1243 </xquery> 1244 </ndg:Action> 983 1245 984 1246 <!-- child's model component--> 985 <ndg: addTripleLiteral>986 <ndg: ontSubject>987 http://www.earthsystemgrid.org/esg.owl#ModelComponent988 </ndg:ontSubject>989 < ndg:ontPredicate dynamic="true"/>990 < ndg:xquery>1247 <ndg:Action> 1248 <ndg:addTripleLiteral> 1249 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1250 <ndg:ontPredicate dynamic="true"/> 1251 </ndg:addTripleLiteral> 1252 <xquery> 991 1253 <![CDATA[ 992 1254 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1018 1280 let $props := for $prop in $item/componentProperties/componentProperty 1019 1281 return 1020 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", string-join(data($prop/value), ','), ";;", ndg:mapProperty($lookup//ndg:entry, concat($type, $prop/shortName)))1282 concat($item/documentID, ";;", string-join(data($prop/value), ','), ";;", ndg:mapProperty($lookup//ndg:entry, concat($type, $prop/shortName))) 1021 1283 return $props 1022 1284 return $types 1023 return $res]]> 1024 </ ndg:xquery>1025 </ndg: addTripleLiteral>1285 return $res]]> 1286 </xquery> 1287 </ndg:Action> 1026 1288 1027 1289 <!-- model and childmodel --> 1028 <ndg: addTripleLiteral>1029 <ndg: ontSubject>1030 http://www.earthsystemgrid.org/esg.owl#Model1031 </ndg:ontSubject>1032 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#isConfigured"/>1033 < ndg:xquery>1290 <ndg:Action> 1291 <ndg:addTripleLiteral> 1292 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1293 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#isConfigured"/> 1294 </ndg:addTripleLiteral> 1295 <xquery> 1034 1296 <![CDATA[ 1035 1297 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1038 1300 let $res := for $item in $nodes 1039 1301 return 1040 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", "true")1302 concat($item/documentID, ";;", "true") 1041 1303 return $res]]> 1042 </ndg:xquery> 1043 </ndg:addTripleLiteral> 1304 </xquery> 1305 </ndg:Action> 1306 1044 1307 1045 1308 <!-- child's model component--> 1046 <ndg: addTripleLiteral>1047 <ndg: ontSubject>1048 http://www.earthsystemgrid.org/esg.owl#ModelComponent1049 </ndg:ontSubject>1050 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#isConfigured"/>1051 < ndg:xquery>1309 <ndg:Action> 1310 <ndg:addTripleLiteral> 1311 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1312 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#isConfigured"/> 1313 </ndg:addTripleLiteral> 1314 <xquery> 1052 1315 <![CDATA[ 1053 1316 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1057 1320 let $res := for $item in $nodes 1058 1321 return 1059 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", "true")1322 concat($item/documentID, ";;", "true") 1060 1323 return $res]]> 1061 </ndg:xquery> 1062 </ndg:addTripleLiteral> 1063 1064 <!-- model and childmodel --> 1065 <ndg:addTripleLiteral> 1066 <ndg:ontSubject> 1067 http://www.earthsystemgrid.org/esg.owl#Model 1068 </ndg:ontSubject> 1069 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasVersion"/> 1070 <ndg:xquery> 1324 </xquery> 1325 </ndg:Action> 1326 1327 1328 <!-- model and childmodel --> 1329 <ndg:Action> 1330 <ndg:addTripleLiteral> 1331 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1332 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasVersion"/> 1333 </ndg:addTripleLiteral> 1334 <xquery> 1071 1335 <![CDATA[ 1072 1336 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1075 1339 let $res := for $item in $nodes 1076 1340 return 1077 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/shortName, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName)1341 concat($item/documentID, ";;", $item/shortName) 1078 1342 return $res]]> 1079 </ndg:xquery> 1080 </ndg:addTripleLiteral> 1343 </xquery> 1344 </ndg:Action> 1345 1081 1346 <!-- child's model component--> 1082 <ndg: addTripleLiteral>1083 <ndg: ontSubject>1084 http://www.earthsystemgrid.org/esg.owl#ModelComponent1085 </ndg:ontSubject>1086 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasVersion"/>1087 < ndg:xquery>1347 <ndg:Action> 1348 <ndg:addTripleLiteral> 1349 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1350 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasVersion"/> 1351 </ndg:addTripleLiteral> 1352 <xquery> 1088 1353 <![CDATA[ 1089 1354 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1093 1358 let $res := for $item in $nodes 1094 1359 return 1095 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/shortName, " ", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName)1360 concat($item/documentID, ";;", $item/shortName) 1096 1361 return $res]]> 1097 </ ndg:xquery>1098 </ndg: addTripleLiteral>1099 1100 <!-- model and childmodel -->1101 <ndg: addTripleLiteral>1102 <ndg: ontSubject>1103 http://www.earthsystemgrid.org/esg.owl#Model1104 </ndg:ontSubject>1105 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasYearReleased"/>1106 < ndg:xquery>1362 </xquery> 1363 </ndg:Action> 1364 1365 <!-- model and childmodel 1366 <ndg:Action> 1367 <ndg:addTripleLiteral> 1368 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1369 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasYearReleased"/> 1370 </ndg:addTripleLiteral> 1371 <xquery> 1107 1372 <![CDATA[ 1108 1373 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1111 1376 let $res := for $item in $nodes 1112 1377 return 1113 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/releaseDate)1378 concat($item/documentID, ";;", $item/releaseDate) 1114 1379 return $res]]> 1115 </ndg:xquery> 1116 </ndg:addTripleLiteral> 1117 <!-- child's model component--> 1118 <ndg:addTripleLiteral> 1119 <ndg:ontSubject> 1120 http://www.earthsystemgrid.org/esg.owl#ModelComponent 1121 </ndg:ontSubject> 1122 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasYearReleased"/> 1123 <ndg:xquery> 1380 </xquery> 1381 </ndg:Action> 1382 --> 1383 1384 <!-- child's model component 1385 <ndg:Action> 1386 <ndg:addTripleLiteral> 1387 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1388 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasYearReleased"/> 1389 </ndg:addTripleLiteral> 1390 <xquery> 1124 1391 <![CDATA[ 1125 1392 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1128 1395 let $res := for $item in $nodes 1129 1396 return 1130 concat($item/ shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/releaseDate)1397 concat($item/documentID, ";;", $item/releaseDate) 1131 1398 return $res]]> 1132 </ndg:xquery> 1133 </ndg:addTripleLiteral> 1399 </xquery> 1400 </ndg:Action> 1401 --> 1134 1402 1135 1403 1136 1404 <!-- model and childmodel --> 1137 <ndg: addTripleLiteral>1138 <ndg: ontSubject>1139 http://www.earthsystemgrid.org/esg.owl#Model1140 </ndg:ontSubject>1141 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPreviousVersion"/>1142 < ndg:xquery>1405 <ndg:Action> 1406 <ndg:addTripleLiteral> 1407 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1408 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPreviousVersion"/> 1409 </ndg:addTripleLiteral> 1410 <xquery> 1143 1411 <![CDATA[ 1144 1412 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1147 1415 let $res := for $item in $nodes 1148 1416 return 1149 concat($item/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/documentGenealogy/relationship/documentRelationship/target/reference/name) 1417 concat($item/documentID, ";;", 1418 if (string-length($item/documentGenealogy/relationship/documentRelationship/target/reference/name) > 0) 1419 then $item/documentGenealogy/relationship/documentRelationship/target/reference/name 1420 else "No previous version") 1150 1421 return $res]]> 1151 </ndg:xquery> 1152 </ndg:addTripleLiteral> 1422 </xquery> 1423 </ndg:Action> 1424 1425 1153 1426 <!-- child's model component--> 1154 <ndg: addTripleLiteral>1155 <ndg: ontSubject>1156 http://www.earthsystemgrid.org/esg.owl#ModelComponent1157 </ndg:ontSubject>1158 < ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPreviousVersion"/>1159 < ndg:xquery>1427 <ndg:Action> 1428 <ndg:addTripleLiteral> 1429 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#ModelComponent"/> 1430 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPreviousVersion"/> 1431 </ndg:addTripleLiteral> 1432 <xquery> 1160 1433 <![CDATA[ 1161 1434 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; … … 1164 1437 let $res := for $item in $nodes 1165 1438 return 1166 concat($item/shortName, "_", CIMRecordSet/CIMRecord/CIMRecord/simulationRun/shortName, ";;", $item/documentGenealogy/relationship/documentRelationship/target/reference/name) 1439 concat($item/documentID, ";;", 1440 if (string-length($item/documentGenealogy/relationship/documentRelationship/target/reference/name) > 0) 1441 then $item/documentGenealogy/relationship/documentRelationship/target/reference/name 1442 else "No previous version") 1167 1443 return $res]]> 1168 </ndg:xquery> 1169 </ndg:addTripleLiteral> 1170 1171 1444 </xquery> 1445 </ndg:Action> 1446 1172 1447 <!-- hasPhysicalDomain ???? --> 1173 <!-- // Add the conformances and deployment info from the simulation. --> 1174 <!-- dealWithInputs --> 1448 <ndg:Action> 1449 <ndg:addTriple> 1450 <ndg:ontSubject uri="http://www.earthsystemgrid.org/esg.owl#Model"/> 1451 <ndg:ontPredicate uri="http://www.earthsystemgrid.org/esg.owl#hasPhysicalDomain"/> 1452 <ndg:ontObject uri="http://www.earthsystemgrid.org/esg.owl#PhysicalDomain"/> 1453 </ndg:addTriple> 1454 <xquery> 1455 <![CDATA[ 1456 declare default element namespace "http://www.metaforclimate.eu/schema/cim/1.5"; 1457 declare namespace xs = "http://www.w3.org/2001/XMLSchema"; 1458 declare namespace ndg = "http://www.ndg.ac.uk"; 1459 declare variable $metaforMapping external; 1460 declare function ndg:getValueFromMap 1461 ($node as node()*, $arg as xs:string) as xs:string* { 1462 let $ret := for $el in $node 1463 return 1464 if (data($el/@metaforName) = $arg) 1465 then data($el/@esgName) 1466 else data(()) 1467 return 1468 if (count($ret) > 0) 1469 then $ret[1] 1470 else data(()) 1471 }; 1472 1473 let $nodes := //CIMRecord/modelComponent | //CIMRecord/modelComponent/childComponent/modelComponent 1474 let $comps := for $comp in $nodes 1475 let $types := for $type in $comp/type 1476 where ($type/vocabularyServer/vocabularyName = "DRS") 1477 return 1478 if (string-length(ndg:getValueFromMap($metaforMapping//ndg:entry, $type/@value)) > 0) 1479 then concat($comp/documentID, ";;", ndg:getValueFromMap($metaforMapping//ndg:entry, $type/@value)) 1480 else () 1481 return $types 1482 return $comps]]> 1483 </xquery> 1484 </ndg:Action> 1485 1486 1175 1487 1176 1488 </ndg:ingester>
Note: See TracChangeset
for help on using the changeset viewer.