메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 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"에 위치함

번호 제목 날짜 조회 수
78 fuseki의 endpoint를 이용한 insert, delete하는 sparql예시 2018.02.14 287
77 전체 컨택스트 내용 file 2017.12.19 283
76 oneM2M Specification(Draft Release 3, 2, 1), Draft Technical Reports 2017.10.25 281
75 fuseki에서 제공하는 script중 s-post를 사용하는 예문 2017.09.15 1002
74 halyard 1.3의 console을 이용하여 100억건의 데이타에 대한 쿼리수행시 ScannerTimeoutException 발생시 조치사항 2017.09.06 925
» RDF4J의 RESTFul API처리 클래스 소스 파악(web module위주) 2017.08.30 431
72 RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용한 CRUD테스트(트랜잭션처리) 2017.08.30 967
71 RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용하여 repository에 CRUD테스트 2017.08.30 899
70 DeviceType이 o:motion-sensor_33 이거나 o:motion-sensor_32 경우의 sparql문장은 다음과 같다. 2017.08.16 973
69 [oneM2M]Ontologies used for oneM2M 2017.08.02 867
68 jena/fuseki 3.4.0 설치 2017.07.25 731
67 LUBM 데이타 생성구문 2017.07.24 329
66 9대가 hbase cluster로 구성된 서버에서 테스트 data를 halyard에 적재하고 테스트 하는 방법및 절차 2017.07.21 184
65 halyard의 console스크립트에서 생성한 repository는 RDF4J Web Applications에서 공유가 되지 않는다. 2017.07.05 806
64 halyard 1.3의 rdf4j-server.war와 rdf4j-workbench.war를 tomcat deploy후 조회시 java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/Cell발생시 조치사항 2017.07.05 242
63 halyard 1.3을 다른 서버로 이전하는 방법 2017.07.05 825
62 숭실대 교수님등 강의영상(바이오데이터마이닝, 빅데이터분산컴퓨팅, 컴퓨터 그래픽스, 데이터베이스응용및 프로그램밍, 데이터베이스, 의생명영상처리, 웹그로그래밍, 데이터마이닝, 컴퓨터구조) file 2017.06.13 488
61 시맨틱 관련 논문 모음 사이트 2017.06.13 246
60 fuseki용 config-examples.ttl 예시 내용 2017.05.17 810
59 fuseki webUI를 통해서 전체 카운트를 하면 급격하게 메모리를 소모해 버리는 문제가 있음 file 2017.04.28 664
위로