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"에 위치함
댓글 0
번호 | 제목 | 날짜 | 조회 수 |
---|---|---|---|
10 | halyard 1.3의 console을 이용하여 100억건의 데이타에 대한 쿼리수행시 ScannerTimeoutException 발생시 조치사항 | 2017.09.06 | 934 |
» | RDF4J의 RESTFul API처리 클래스 소스 파악(web module위주) | 2017.08.30 | 443 |
8 | RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용한 CRUD테스트(트랜잭션처리) | 2017.08.30 | 969 |
7 | RDF4J의 rdf4j-server.war가 제공하는 RESTFul API를 이용하여 repository에 CRUD테스트 | 2017.08.30 | 899 |
6 | 9대가 hbase cluster로 구성된 서버에서 테스트 data를 halyard에 적재하고 테스트 하는 방법및 절차 | 2017.07.21 | 184 |
5 | halyard의 console스크립트에서 생성한 repository는 RDF4J Web Applications에서 공유가 되지 않는다. | 2017.07.05 | 836 |
4 | halyard 1.3의 rdf4j-server.war와 rdf4j-workbench.war를 tomcat deploy후 조회시 java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/Cell발생시 조치사항 | 2017.07.05 | 243 |
3 | halyard 1.3을 다른 서버로 이전하는 방법 | 2017.07.05 | 826 |
2 | https://github.com/Merck/Halyard프로젝트 컴파일및 배포/테스트 | 2017.01.24 | 246 |
1 | Halyard - RDF4J와 Apache HBase를 이용하여 구현된 TripleStore이며 SPARQL 1.1쿼리를 지원한다. | 2016.12.29 | 811 |