메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


rdf:type이 b:Device이고 b:Device의 위치가 o:techno인 경우에 DeviceType을 여러개 가지는(hasDeviceType)는 경우는 아래와 같이 sparql을 만들어서 or 기능을 구현할 수도 있다.(DeviceType이 o:motion-sensor_33 이거나 o:motion-sensor_32 경우)


-------------union으로 or을 구현한 예제

select  distinct  ?uri  where { 
 ?uri rdf:type b:Device.

 ?uri dul:hasLocation o:techno.
  { ?uri o:hasDeviceType o:motion-sensor_33 .}
   union 

  { ?uri o:hasDeviceType o:motion-sensor_32 .}

}



*참고 : sparql에서는 아래와 같이 각 ?s ?p ?o중의 하나에 직접 ||, &&, or , and등을 이용한 형태를 지원하지 않지 않으므로 filter문을 이용하여 처리해야 함


----지원하지 않는 형태----

select * where {

  ?s ?p ('a' or 'b')

}


----filter문을 이용해서 or을 구현한 형태

select *
where {
  ?uri rdf:type b:Device.
  ?uri dul:hasLocation o:techno . 
  ?uri o:hasDeviceType ?devType .
  filter (?devType = o:/motion-sensor_32 || ?devType = o:/motion-sensor_33) .
}


번호 제목 날짜 조회 수
78 cumulusRDF 1.0.1설치및 "KeyspaceCumulus" keyspace확인하기 file 2016.04.15 8722
77 LUBM 데이타 생성구문 2017.07.24 7512
76 protege 설명및 사용법 file 2017.04.04 6115
75 System Properties Comparison Elasticsearch vs. Hive vs. Jena file 2016.03.10 5708
74 9대가 hbase cluster로 구성된 서버에서 테스트 data를 halyard에 적재하고 테스트 하는 방법및 절차 2017.07.21 4733
73 Jena 2.3를 Hadoop 2.7.2의 NFS로 mount하고 fuseki를 이용하여 start할때 오류 메세지 2016.12.02 4497
72 커리 변경 이벤트를 처리하기 위한 구현클래스 2016.07.21 4342
71 solrdf초기 기동시 "Caused by: java.lang.IllegalAccessError: tried to access field org.apache.solr.handler.RequestHandlerBase.log from class org.gazzax.labs.solrdf.handler.update.RdfUpdateRequestHandler" 오류가 발생시 조치사항 2016.04.22 4090
70 drools에서 drl관련 로그를 기록하기 위한 클래스 파일 2016.07.21 4067
69 halyard의 console스크립트에서 생성한 repository는 RDF4J Web Applications에서 공유가 되지 않는다. 2017.07.05 4039
68 ServerInfo객체파일 2016.07.21 4024
67 Drools 6.0 - 비즈니스 룰 기반으로 간단한 룰 애플리케이션 만들기 file 2016.07.18 3943
66 python실행시 ValueError: zero length field name in format오류 해결방법 2016.05.27 3929
65 특정문자열이나 URI를 임의로 select 절에 지정하여 사용할때 사용하는 sparql 문장 2016.08.25 3905
64 SPIN(SPARQL Inference Notation)이란.. file 2016.02.25 3835
63 update(update와 delete->insert)사용시 주의/참고사항 2016.01.06 3817
62 fuseki가 제공하는 web ui를 통해서 dataset를 remove->create할 경우 동일한 동일한 이름으로 지정했을때 fuseki-server.jar가 뜨지 않는 현상 2017.02.03 3790
61 fuseki에서 제공하는 script중 s-post를 사용하는 예문 2017.09.15 3771
60 문자열을 숫자(integer)로 casting하기 2016.01.13 3751
59 fuseki webUI를 통해서 전체 카운트를 하면 급격하게 메모리를 소모해 버리는 문제가 있음 file 2017.04.28 3742
위로