메뉴 건너뛰기

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"에 위치함

번호 제목 날짜 조회 수
464 권한회수 및 권한부여 명령 몇가지 2017.11.16 1236
463 db를 통째로 새로운 이름의 db로 복사하는 방법/절차 2017.11.14 1135
462 oneM2M Specification(Draft Release 3, 2, 1), Draft Technical Reports 2017.10.25 471
461 Windows7 64bit 환경에서 ElasticSearch 5.6.3설치하기 2017.10.13 1123
460 windows 혹은 mac에서 docker설치하기 위한 파일 2017.10.13 237
459 lagom-windows용 build.sbt파일 내용 2017.10.12 467
458 lagom-linux용 build.sbt파일 내용 2017.10.12 1737
457 lagom의 online-auction-java프로젝트 실행시 외부의 kafka/cassandra를 사용하도록 설정하는 방법 2017.10.12 967
456 lagom의 online-auction-java프로젝트 실행시 "Could not find Cassandra contact points, due to: ServiceLocator is not bound" 경고 발생시 조치사항 2017.10.12 514
455 Hadoop 2.7.x에서 사용할 수 있는 파일/디렉토리 관련 util성 클래스 파일 2017.09.28 199
454 python3.5에서 numpy버젼에 따른 문제점을 조치하는 방법및 pymysql import할때 오류 발생시 조치사항 2017.09.28 768
453 fuseki에서 제공하는 script중 s-post를 사용하는 예문 2017.09.15 1043
452 core 'gc_shard3_replica2' is already locked라는 오류가 발생할때 조치사항 2017.09.14 1382
451 editLog의 문제로 발생하는 journalnode 기동 오류 발생시 조치사항 2017.09.14 562
450 halyard 1.3의 console을 이용하여 100억건의 데이타에 대한 쿼리수행시 ScannerTimeoutException 발생시 조치사항 2017.09.06 952
449 hadoop cluster구성된 노드를 확인시 Capacity를 보면 색이 붉은색으로 표시되어 있는 경우나 Unhealthy인 경우 처리방법 2017.08.30 433
448 파일은 남겨두고 파일 내용만 지우고자 할 때. 2017.08.30 481
» RDF4J의 RESTFul API처리 클래스 소스 파악(web module위주) 2017.08.30 574
446 RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용한 CRUD테스트(트랜잭션처리) 2017.08.30 1030
445 RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용하여 repository에 CRUD테스트 2017.08.30 901
위로