Project

General

Profile

« Previous | Next » 

Revision 8708

include characteristic_sm field with SPARQL query

View differences:

application-context-oa.xml
8 8
			value="/d100:systemMetadata/formatId[text()='http://www.w3.org/TR/rdf-syntax-grammar']" />
9 9
		<property name="fieldList">
10 10
			<list>
11
				<ref bean="annotation.measurement" />
11
				<ref bean="annotation.standard" />
12
				<ref bean="annotation.characteristic" />
12 13
			</list>
13 14
		</property>	
14 15
	</bean>
15 16
	
16
	<bean id="annotation.measurement" class="edu.ucsb.nceas.metacat.index.annotation.SparqlField">
17
	<bean id="annotation.standard" class="edu.ucsb.nceas.metacat.index.annotation.SparqlField">
17 18
		<constructor-arg name="name" value="standard_sm" />
18 19
		<constructor-arg name="query">
19 20
			<value>
......
48 49
		</constructor-arg>
49 50
		<!--property name="multivalue" value="false" /-->
50 51
	</bean>
52
	
53
	<bean id="annotation.characteristic" class="edu.ucsb.nceas.metacat.index.annotation.SparqlField">
54
		<constructor-arg name="name" value="characteristic_sm" />
55
		<constructor-arg name="query">
56
			<value>
57
				<![CDATA[
58
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
59
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
60
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
61
				PREFIX oboe-core: <http://ecoinformatics.org/oboe/oboe.1.0/oboe-core.owl#> 
62
				PREFIX oa: <http://www.w3.org/ns/oa#>
63
				PREFIX dcterms: <http://purl.org/dc/terms/>
64
				PREFIX foaf: <http://xmlns.com/foaf/0.1/>
51 65

  
66
				SELECT ?characteristic_sm ?pid
67
				FROM <$GRAPH_NAME>
68
				WHERE { 
69
						
70
						?measurement rdf:type oboe-core:Measurement .
71
						?measurement rdf:type ?restriction .
72
						?restriction owl:onProperty oboe-core:ofCharacteristic .
73
						?restriction owl:allValuesFrom ?characteristic .
74
						?characteristic rdfs:subClassOf+ ?characteristic_sm .
75
						?characteristic_sm rdfs:subClassOf oboe-core:Characteristic .
76
						
77
						?annotation oa:hasBody ?measurement .												
78
						?annotation oa:hasTarget ?target .
79
						?target oa:hasSource ?metadata .
80
						?metadata dcterms:identifier ?pid . 
81
						
82
				 	} 
83
				 ]]>
84
			</value>
85
		</constructor-arg>
86
		<!--property name="multivalue" value="false" /-->
87
	</bean>
88

  
52 89
</beans>

Also available in: Unified diff