메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


* rdf4j-http-workbench모듈은 java servlet을 이용하여 구현했고, rdf4j-http-server는 spring기반으로 구현되어 있음


1. rdf4j-http-workbench : rdf4j-workbench.war를 이용하여 web에서 작업할때 사용되는 모듈(프로젝트)

  가. /rdf4j-http-workbench/src/main/webapp/WEB-INF/web.xml에서 workbench의 RESTFul API와 매핑되는 class파일을 지정함


*rdf4j-workbench.war의 API에서 사용되는 URL매핑(web.xml파일)

<?xml version="1.0" encoding="UTF-8"?>
<web-app>

	<display-name>RDF4J Workbench</display-name>
	<description>RDF4J Workbench</description>

	<filter>
		<filter-name>redirect</filter-name>
		<filter-class>
			org.eclipse.rdf4j.workbench.proxy.RedirectFilter
		</filter-class>
		<init-param>
			<param-name>/</param-name>
			<param-value>/repositories</param-value>
		</init-param>
	</filter>

	<filter>
		<filter-name>cache</filter-name>
		<filter-class>
			org.eclipse.rdf4j.workbench.proxy.CookieCacheControlFilter
		</filter-class>
	</filter>

	<filter>
		<filter-name>CacheFilter</filter-name>
		<filter-class>org.eclipse.rdf4j.workbench.proxy.CacheFilter</filter-class>
		<init-param>
			<param-name>Cache-Control</param-name>
			<param-value>600</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>redirect</filter-name>
		<url-pattern>/</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>cache</filter-name>
		<url-pattern>/repositories/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>CacheFilter</filter-name>
		<url-pattern>*</url-pattern>
	</filter-mapping>

	<servlet>
		<servlet-name>workbench</servlet-name>
		<servlet-class>
			org.eclipse.rdf4j.workbench.proxy.WorkbenchGateway
		</servlet-class>
		<init-param>
			<param-name>transformations</param-name>
			<param-value>/transformations</param-value>
		</init-param>
		<init-param>
			<param-name>default-server</param-name>
			<param-value>/rdf4j-server</param-value>
		</init-param>
		<init-param>
			<param-name>accepted-server-prefixes</param-name>
			<param-value>file: http: https:</param-value>
		</init-param>
		<init-param>
			<param-name>change-server-path</param-name>
			<param-value>/NONE/server</param-value>
		</init-param>
		<init-param>
			<param-name>cookie-max-age</param-name>
			<param-value>2592000</param-value>
		</init-param>
		<init-param>
			<param-name>no-repository-id</param-name>
			<param-value>NONE</param-value>
		</init-param>
		<init-param>
			<param-name>default-path</param-name>
			<param-value>/NONE/repositories</param-value>
		</init-param>
		<init-param>
			<param-name>default-command</param-name>
			<param-value>/summary</param-value>
		</init-param>
		<init-param>
			<param-name>default-limit</param-name>
			<param-value>100</param-value>
		</init-param>
		<init-param>
			<param-name>default-queryLn</param-name>
			<param-value>SPARQL</param-value>
		</init-param>
		<init-param>
			<param-name>default-infer</param-name>
			<param-value>true</param-value>
		</init-param>
		<init-param>
			<param-name>default-Accept</param-name>
			<param-value>application/rdf+xml</param-value>
		</init-param>
		<init-param>
			<param-name>default-Content-Type</param-name>
			<param-value>application/rdf+xml</param-value>
		</init-param>
		<init-param>
			<param-name>/summary</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.SummaryServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/info</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.InfoServlet</param-value>
		</init-param>
		<init-param>
			<param-name>/information</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.InformationServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/repositories</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.RepositoriesServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/create</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.CreateServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/delete</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.DeleteServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/namespaces</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.NamespacesServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/contexts</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.ContextsServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/types</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.TypesServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/explore</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.ExploreServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/query</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.QueryServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/saved-queries</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.SavedQueriesServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/export</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.ExportServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/add</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.AddServlet</param-value>
		</init-param>
		<init-param>
			<param-name>/remove</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.RemoveServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/clear</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.ClearServlet
			</param-value>
		</init-param>
		<init-param>
			<param-name>/update</param-name>
			<param-value>org.eclipse.rdf4j.workbench.commands.UpdateServlet
			</param-value>
		</init-param>
	</servlet>

	<servlet-mapping>
		<servlet-name>workbench</servlet-name>
		<url-pattern>/repositories/*</url-pattern>
	</servlet-mapping>

</web-app>


  나. rdf4j-http-workbench.war에서 사용하는 class파일(예,StatementsController.java)은 "/rdf4j-http-server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/statements/StatementsController.java"등에 위치함


2. rdf4j-http-server : rdf4j-server.war를 이용하여 RESTFul API를 호출할때 사용되는 모듈(프로젝트)

  가. /rdf4j-http-server/src/main/webapp/WEB-INF/web.xml에서 아래와 같이 설정xml파일을 지정함

<servlet>
	    <servlet-name>rdf4j-http-server</servlet-name>
    	<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
	    <init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>/WEB-INF/common-webapp-servlet.xml, /WEB-INF/common-webapp-system-servlet.xml, /WEB-INF/rdf4j-http-server-servlet.xml</param-value>
		</init-param>
	    <load-on-startup>100</load-on-startup>
	</servlet>

  나. /rdf4j-http-server/src/main/webapp/WEB-INF/rdf4j-http-server-servlet.xml에서 API와 매핑되는 class파일을 지정함


*rdf4j-server.war의 repository관련 API에서 사용되는 URL매핑

<bean id="rdf4jRepositoryUrlMapping"
		class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
		<property name="order" value="2" />
		<property name="alwaysUseFullPath" value="true" />
		<property name="mappings">
			<props>
				<prop key="/repositories/*/namespaces/*">rdf4jRepositoryNamespaceController</prop>
				<prop key="/repositories/*/namespaces">rdf4jRepositoryNamespacesController</prop>
				<prop key="/repositories/*/contexts">rdf4jRepositoryContextsController</prop>
				<prop key="/repositories/*/statements">rdf4jRepositoryStatementsController</prop>
				<prop key="/repositories/*/rdf-graphs">rdf4jRepositoryContextsController</prop>
				<prop key="/repositories/*/rdf-graphs/*">rdf4jRepositoryGraphController</prop>
				<prop key="/repositories/*/size">rdf4jRepositorySizeController</prop>
				<prop key="/repositories/*/transactions">rdf4jRepositoryTransactionStartController</prop>
				<prop key="/repositories/*/transactions/*">rdf4jRepositoryTransactionController</prop>
				<prop key="/repositories/*">rdf4jRepositoryController</prop>
			</props>
		</property>
		<property name="interceptors">
			<list>
				<ref bean="rdf4jRepositoryInterceptor" />
			</list>
		</property>
	</bean>


*URL매핑에 해당되는 처리 class매핑

<!-- CONTROLLERS -->
	<bean id="rdf4jProtocolController" class="org.eclipse.rdf4j.http.server.protocol.ProtocolController" />

	<bean id="rdf4jRepositoryListController"
		class="org.eclipse.rdf4j.http.server.repository.RepositoryListController">
		<property name="repositoryManager" ref="rdf4jRepositoryManager" />
	</bean>
	<bean id="rdf4jRepositoryController" class="org.eclipse.rdf4j.http.server.repository.RepositoryController">
		<property name="repositoryManager" ref="rdf4jRepositoryManager" />
	</bean>
	<bean id="rdf4jRepositoryContextsController"
		class="org.eclipse.rdf4j.http.server.repository.contexts.ContextsController" />
	<bean id="rdf4jRepositoryNamespacesController"
		class="org.eclipse.rdf4j.http.server.repository.namespaces.NamespacesController" />
	<bean id="rdf4jRepositoryNamespaceController"
		class="org.eclipse.rdf4j.http.server.repository.namespaces.NamespaceController" />
	<bean id="rdf4jRepositorySizeController" class="org.eclipse.rdf4j.http.server.repository.size.SizeController" />
	<bean id="rdf4jRepositoryStatementsController"
		class="org.eclipse.rdf4j.http.server.repository.statements.StatementsController" />
	<bean id="rdf4jRepositoryGraphController"
		class="org.eclipse.rdf4j.http.server.repository.graph.GraphController" />
	<bean id="rdf4jRepositoryTransactionController"
		class="org.eclipse.rdf4j.http.server.repository.transaction.TransactionController" />
	<bean id="rdf4jRepositoryTransactionStartController"
		class="org.eclipse.rdf4j.http.server.repository.transaction.TransactionStartController" />

다 rdf4j-server.war가 사용하는 class파일은(예, StatementsController.java) "/rdf4j-http-server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/statements/StatementsController.java"에 위치함

번호 제목 글쓴이 날짜 조회 수
455 python3.5에서 numpy버젼에 따른 문제점을 조치하는 방법및 pymysql import할때 오류 발생시 조치사항 총관리자 2017.09.28 72
454 fuseki에서 제공하는 script중 s-post를 사용하는 예문 총관리자 2017.09.15 28
453 core 'gc_shard3_replica2' is already locked라는 오류가 발생할때 조치사항 총관리자 2017.09.14 19
452 editLog의 문제로 발생하는 journalnode 기동 오류 발생시 조치사항 총관리자 2017.09.14 218
451 halyard 1.3의 console을 이용하여 100억건의 데이타에 대한 쿼리수행시 ScannerTimeoutException 발생시 조치사항 총관리자 2017.09.06 126
450 hadoop cluster구성된 노드를 확인시 Capacity를 보면 색이 붉은색으로 표시되어 있는 경우나 Unhealthy인 경우 처리방법 총관리자 2017.08.30 38
449 파일은 남겨두고 파일 내용만 지우고자 할 때. 총관리자 2017.08.30 27
» RDF4J의 RESTFul API처리 클래스 소스 파악(web module위주) 총관리자 2017.08.30 153
447 RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용한 CRUD테스트(트랜잭션처리) 총관리자 2017.08.30 32
446 RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용하여 repository에 CRUD테스트 총관리자 2017.08.30 47
445 DeviceType이 o:motion-sensor_33 이거나 o:motion-sensor_32 경우의 sparql문장은 다음과 같다. 총관리자 2017.08.16 33
444 [oneM2M]Ontologies used for oneM2M 총관리자 2017.08.02 46
443 Windows7 64bit 환경에서 Apache Spark 2.2.0 설치하기 총관리자 2017.07.26 234
442 Windows7 64bit 환경에서 Apache Hadoop 2.7.1설치하기 총관리자 2017.07.26 209
441 jena/fuseki 3.4.0 설치 총관리자 2017.07.25 153
440 LUBM 데이타 생성구문 총관리자 2017.07.24 137
439 Core with name 'xx_shard4_replica1' already exists. 발생시 조치사항 총관리자 2017.07.22 46
438 9대가 hbase cluster로 구성된 서버에서 테스트 data를 halyard에 적재하고 테스트 하는 방법및 절차 총관리자 2017.07.21 53
437 갑자기 DataNode가 java.io.IOException: Premature EOF from inputStream를 반복적으로 발생시키다가 java.lang.OutOfMemoryError: Java heap space를 내면서 죽는 경우 조치방법 총관리자 2017.07.19 1250
436 Current heap configuration for MemStore and BlockCache exceeds the threshold required for successful cluster operation 총관리자 2017.07.18 885

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로