메뉴 건너뛰기

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) .
}


번호 제목 날짜 조회 수
470 [Magento]php7에 Composer를 이용하여 Magento 2.1.3 설치 file 2017.01.30 4355
469 No broker partitions consumed by consumer thread오류 발생시 확인/조치할 사항 2016.09.02 4354
468 Hadoop 완벽 가이드 정리된 링크 2016.04.19 4354
467 centsOS vsftpd설치하기 2013.12.17 4352
466 Cassandra 3.4(3.10) 설치/설정 (5대로 clustering) 2016.04.11 4347
465 마이바티스(MyBatis)쿼리로그 출력및 정렬하기 2015.12.01 4347
464 Using The ZooKeeper CLI에서 zkCli의 위치 2014.11.02 4347
463 커리 변경 이벤트를 처리하기 위한 구현클래스 2016.07.21 4345
462 build할때 unmappable character for encoding MS949 에러 발생시 조치사항 2016.08.03 4344
461 AnalysisException: Incomplatible return type 'DECIMAL(38,0)' and 'DECIMAL(38,5)' of exprs가 발생시 조치 2021.07.26 4341
460 Flume과 Kafka를 사용한 초당 100만개 로그 수집 테스트 file 2016.10.31 4341
459 [Impala TLS/SSL이슈]RangerAdminRESTClient.java:151] Failed to get response, Error is: TrustManager is not specified 2023.02.02 4339
458 Impala의 Queries탭에서 여러조건으로 쿼리 찾기 2018.05.09 4339
457 jsoup 사용 예제 2014.06.06 4338
456 CentOS 7.x에 Jupyter설치 2018.04.18 4337
455 [sentry]role부여후 테이블명이 변경되어 오류가 발생할때 조치방법 2018.10.16 4336
454 conda를 이용한 jupyterhub(v0.9)및 jupyter설치 (v4.4.0) 2018.07.30 4327
453 로컬에 있는 jar파일을 지정하고 dependency로 가져오기 2016.08.19 4327
452 apk 파일 위치 file 2015.05.25 4325
451 [KTS Cluster의 Key Trustee Server]self-signed 인증서 발급및 설정 방법 2023.06.27 4324
위로