<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<bean id="annotatorSubprocessor" class="org.dataone.cn.indexer.annotation.AnnotatorSubprocessor">
		<property name="httpService" ref="httpService" />
        <property name="processorUtility"  ref="subprocessorUtility" />
		<!-- match annotation documents -->
		<property name="matchDocuments">
			<list>
				<value>http://docs.annotatorjs.org/en/v1.2.x/annotation-format.html</value>
			</list>
		</property>
		<property name="fieldList">
			<list>
				<ref bean="annotation.expansion" />
				<ref bean="annotation.bioportal.expansion" />
				<ref bean="annotation.esor.expansion" />
				<ref bean="annotation.cosine.expansion" />
			</list>
		</property>
		<property name="fieldsToMerge">
     		<list>
     			<value>sem_annotation</value>
     			<value>sem_annotation_bioportal_sm</value>
     			<value>sem_annotation_esor_sm</value>     	
     			<value>sem_annotation_cosine_sm</value>     			     					
     			<value>sem_annotates</value>
     			<value>sem_annotated_by</value>
     		</list>
     	</property>
	</bean>
	
	<bean id="annotation.expansion" class="org.dataone.cn.indexer.annotation.SparqlField">
		<constructor-arg name="name" value="sem_annotation" />
		<constructor-arg name="query">
			<value>
				<![CDATA[
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
				
				SELECT ?sem_annotation
				WHERE { 
						<$CONCEPT_URI> rdfs:subClassOf+ ?sem_annotation .
				 	} 
				 ]]>
			</value>
		</constructor-arg>
		<!--property name="multivalue" value="false" /-->
	</bean>
	
	<!-- bioportal-based annotation -->
	<bean id="annotation.bioportal.expansion" class="org.dataone.cn.indexer.annotation.SparqlField">
		<constructor-arg name="name" value="sem_annotation_bioportal_sm" />
		<constructor-arg name="query">
			<value>
				<![CDATA[
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
				
				SELECT ?sem_annotation_bioportal_sm
				WHERE { 
						<$CONCEPT_URI> rdfs:subClassOf+ ?sem_annotation_bioportal_sm .
				 	} 
				 ]]>
			</value>
		</constructor-arg>
	</bean>
	<bean id="annotation.bioportal.raw" class="org.dataone.cn.indexer.annotation.SparqlField">
		<constructor-arg name="name" value="sem_annotation_bioportal_raw_sm" />
		<constructor-arg name="query">
			<value>
				<![CDATA[
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
				
				SELECT ?sem_annotation_bioportal_raw_sm
				WHERE { 
						<$CONCEPT_URI> rdf:about ?sem_annotation_bioportal_raw_sm .
				 	} 
				 ]]>
			</value>
		</constructor-arg>
	</bean>
	
		<!-- esor-based annotation -->
	<bean id="annotation.esor.expansion" class="org.dataone.cn.indexer.annotation.SparqlField">
		<constructor-arg name="name" value="sem_annotation_esor_sm" />
		<constructor-arg name="query">
			<value>
				<![CDATA[
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
				
				SELECT ?sem_annotation_esor_sm
				WHERE { 
						<$CONCEPT_URI> rdfs:subClassOf+ ?sem_annotation_esor_sm .
				 	} 
				 ]]>
			</value>
		</constructor-arg>
	</bean>
	<bean id="annotation.esor.raw" class="org.dataone.cn.indexer.annotation.SparqlField">
		<constructor-arg name="name" value="sem_annotation_esor_raw_sm" />
		<constructor-arg name="query">
			<value>
				<![CDATA[
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
				
				SELECT ?sem_annotation_esor_raw_sm
				WHERE { 
						<$CONCEPT_URI> rdf:about ?sem_annotation_esor_raw_sm .
				 	} 
				 ]]>
			</value>
		</constructor-arg>
	</bean>
	
	<!-- cosine-based annotation -->
	<bean id="annotation.cosine.expansion" class="org.dataone.cn.indexer.annotation.SparqlField">
		<constructor-arg name="name" value="sem_annotation_cosine_sm" />
		<constructor-arg name="query">
			<value>
				<![CDATA[
				PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
				PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
				PREFIX owl: <http://www.w3.org/2002/07/owl#> 
				
				SELECT ?sem_annotation_cosine_sm
				WHERE { 
						<$CONCEPT_URI> rdfs:subClassOf+ ?sem_annotation_cosine_sm .
				 	} 
				 ]]>
			</value>
		</constructor-arg>
	</bean>

</beans>