"제도와 인사의 관계성 데이터 아카이브에 대한 SPARQL 활용 예시"의 두 판 사이의 차이

김바로 온톨로지 위키(ddokbaro's Ontology WIKI
이동: 둘러보기, 검색
222번째 줄: 222번째 줄:
  
 
[http://61.35.170.118:8890/sparql?default-graph-uri=&query=PREFIX+schoolsys%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fschoolsystem%23%3E%0D%0APREFIX+historygokr%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fhistorygokr%23%3E%0D%0APREFIX+kyujanggak%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fkyujanggak%23%3E%0D%0APREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+xml%3A+%3Chttp%3A%2F%2Fwww.w3.org%2FXML%2F1998%2Fnamespace%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0Aselect+%3Feventtemp+%3Fpersontempname+%3Feventtypetempname+%3Fschooltempname+%3Ftime+%3Fwebre+%0D%0Awhere+%7B%0D%0A%3Fpersontemp+rdf%3Atype+schoolsys%3APerson+.%0D%0A%3Fpersontemp+rdfs%3Alabel+%3Fpersontempname+%0D%0AFILTER+regex%28+str%28%3Fpersontempname+%29%2C%22%E5%85%83%E6%B3%B3%E7%BE%A9%22+%29%0D%0A%3Feventtemp+schoolsys%3AhasEventObject+%3Fpersontemp+.%0D%0A%3Feventtemp+schoolsys%3AhasEventType+%3Feventtypetemp+.%0D%0A%3Feventtypetemp+rdfs%3Alabel+%3Feventtypetempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Feventtypetempname+%29%2C+%22ko-hanza%22%29%29%0D%0A%3Feventtemp+schoolsys%3AhasEventPostObject+%3Fschooltemp+.%0D%0A%3Fschooltemp+rdf%3Atype+schoolsys%3AGroup+.%0D%0A%3Fschooltemp+rdfs%3Alabel+%3Fschooltempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Fschooltempname+%29%2C+%22ko-hanza%22%29%29%0D%0A%3Feventtemp+schoolsys%3AhasTimeValue+%3Ftime+.%0D%0A%3Feventtemp+schoolsys%3AhasWebResource+%3Fwebre+.%0D%0A%7D+order+by+%3Ftime%0D%0A&format=text%2Fhtml&timeout=0&debug=on 결과보기]
 
[http://61.35.170.118:8890/sparql?default-graph-uri=&query=PREFIX+schoolsys%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fschoolsystem%23%3E%0D%0APREFIX+historygokr%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fhistorygokr%23%3E%0D%0APREFIX+kyujanggak%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fkyujanggak%23%3E%0D%0APREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+xml%3A+%3Chttp%3A%2F%2Fwww.w3.org%2FXML%2F1998%2Fnamespace%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0Aselect+%3Feventtemp+%3Fpersontempname+%3Feventtypetempname+%3Fschooltempname+%3Ftime+%3Fwebre+%0D%0Awhere+%7B%0D%0A%3Fpersontemp+rdf%3Atype+schoolsys%3APerson+.%0D%0A%3Fpersontemp+rdfs%3Alabel+%3Fpersontempname+%0D%0AFILTER+regex%28+str%28%3Fpersontempname+%29%2C%22%E5%85%83%E6%B3%B3%E7%BE%A9%22+%29%0D%0A%3Feventtemp+schoolsys%3AhasEventObject+%3Fpersontemp+.%0D%0A%3Feventtemp+schoolsys%3AhasEventType+%3Feventtypetemp+.%0D%0A%3Feventtypetemp+rdfs%3Alabel+%3Feventtypetempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Feventtypetempname+%29%2C+%22ko-hanza%22%29%29%0D%0A%3Feventtemp+schoolsys%3AhasEventPostObject+%3Fschooltemp+.%0D%0A%3Fschooltemp+rdf%3Atype+schoolsys%3AGroup+.%0D%0A%3Fschooltemp+rdfs%3Alabel+%3Fschooltempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Fschooltempname+%29%2C+%22ko-hanza%22%29%29%0D%0A%3Feventtemp+schoolsys%3AhasTimeValue+%3Ftime+.%0D%0A%3Feventtemp+schoolsys%3AhasWebResource+%3Fwebre+.%0D%0A%7D+order+by+%3Ftime%0D%0A&format=text%2Fhtml&timeout=0&debug=on 결과보기]
 +
 +
 +
 +
 +
 +
// 충주부공립소학교의 인사기록을 보고 싶다.
 +
 +
// 충주부공립소학교의 직원명, 인사운용양태, 인사운용시간를 시간 순서대로 출력하라.
 +
 +
<source lang="text">
 +
PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
 +
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
 +
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
 +
PREFIX owl: <http://www.w3.org/2002/07/owl#>
 +
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 +
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
 +
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
 +
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 +
select ?time ?persontempname ?preobjecttempname ?eventtypetempname ?postobjecttempname
 +
where {
 +
?eventtemp rdf:type kyujanggak:Event.
 +
?eventtemp schoolsys:hasEventObject ?persontemp .
 +
?persontemp rdf:type schoolsys:Person .
 +
?persontemp rdfs:label ?persontempname .
 +
FILTER(LANGMATCHES(LANG(?persontempname ), "ko-hanza"))
 +
?eventtemp schoolsys:hasEventType ?eventtypetemp .
 +
?eventtypetemp rdfs:label ?eventtypetempname .
 +
FILTER(LANGMATCHES(LANG(?eventtypetempname ), "ko-hanza"))
 +
OPTIONAL {?eventtemp schoolsys:hasEventPostObject ?postobjecttemp .
 +
?postobjecttemp rdf:type schoolsys:Group .
 +
?postobjecttemp rdfs:label ?postobjecttempname.
 +
FILTER(LANGMATCHES(LANG(?postobjecttempname), "ko-hanza"))}
 +
OPTIONAL {?eventtemp schoolsys:hasEventPreObject ?preobjecttemp .
 +
?preobjecttemp rdf:type schoolsys:Group .
 +
?preobjecttemp rdfs:label ?preobjecttempname .
 +
FILTER(LANGMATCHES(LANG(?preobjecttempname ), "ko-hanza"))}
 +
FILTER ( regex( str(?postobjecttempname),"忠州府公立小學校" ) || regex( str(?postobjecttempname),"忠淸北道觀察府公立小學校" ) || regex( str(?postobjecttempname),"公立忠州普通學校" ) || regex( str(?preobjecttempname),"忠州府公立小學校" ) || regex( str(?preobjecttempname ),"忠淸北道觀察府公立小學校" ) || regex( str(?preobjecttempname),"公立忠州普通學校" ) )
 +
?eventtemp schoolsys:hasTimeValue ?time.
 +
} order by ?time
 +
 +
</source>
 +
 +
[http://61.35.170.118:8890/sparql?default-graph-uri=&query=PREFIX+schoolsys%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fschoolsystem%23%3E%0D%0APREFIX+historygokr%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fhistorygokr%23%3E%0D%0APREFIX+kyujanggak%3A+%3Chttp%3A%2F%2Fdh.aks.ac.kr%2Fontologies%2Fpersonnelmatters%2Fkyujanggak%23%3E%0D%0APREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+xml%3A+%3Chttp%3A%2F%2Fwww.w3.org%2FXML%2F1998%2Fnamespace%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0Aselect+%3Ftime+%3Fpersontempname+%3Fpreobjecttempname+%3Feventtypetempname+%3Fpostobjecttempname+%0D%0Awhere+%7B%0D%0A%3Feventtemp+rdf%3Atype+kyujanggak%3AEvent.%0D%0A%3Feventtemp+schoolsys%3AhasEventObject+%3Fpersontemp+.%0D%0A%3Fpersontemp+rdf%3Atype+schoolsys%3APerson+.%0D%0A%3Fpersontemp+rdfs%3Alabel+%3Fpersontempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Fpersontempname+%29%2C+%22ko-hanza%22%29%29%0D%0A%3Feventtemp+schoolsys%3AhasEventType+%3Feventtypetemp+.%0D%0A%3Feventtypetemp+rdfs%3Alabel+%3Feventtypetempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Feventtypetempname+%29%2C+%22ko-hanza%22%29%29%0D%0AOPTIONAL+%7B%3Feventtemp+schoolsys%3AhasEventPostObject+%3Fpostobjecttemp+.%0D%0A%3Fpostobjecttemp+rdf%3Atype+schoolsys%3AGroup+.%0D%0A%3Fpostobjecttemp+rdfs%3Alabel+%3Fpostobjecttempname.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Fpostobjecttempname%29%2C+%22ko-hanza%22%29%29%7D%0D%0AOPTIONAL+%7B%3Feventtemp+schoolsys%3AhasEventPreObject+%3Fpreobjecttemp+.%0D%0A%3Fpreobjecttemp+rdf%3Atype+schoolsys%3AGroup+.%0D%0A%3Fpreobjecttemp+rdfs%3Alabel+%3Fpreobjecttempname+.%0D%0AFILTER%28LANGMATCHES%28LANG%28%3Fpreobjecttempname+%29%2C+%22ko-hanza%22%29%29%7D%0D%0AFILTER+%28+regex%28+str%28%3Fpostobjecttempname%29%2C%22%E5%BF%A0%E5%B7%9E%E5%BA%9C%E5%85%AC%E7%AB%8B%E5%B0%8F%E5%AD%B8%E6%A0%A1%22+%29+%7C%7C+regex%28+str%28%3Fpostobjecttempname%29%2C%22%E5%BF%A0%E6%B7%B8%E5%8C%97%E9%81%93%E8%A7%80%E5%AF%9F%E5%BA%9C%E5%85%AC%E7%AB%8B%E5%B0%8F%E5%AD%B8%E6%A0%A1%22+%29+%7C%7C+regex%28+str%28%3Fpostobjecttempname%29%2C%22%E5%85%AC%E7%AB%8B%E5%BF%A0%E5%B7%9E%E6%99%AE%E9%80%9A%E5%AD%B8%E6%A0%A1%22+%29+%7C%7C+regex%28+str%28%3Fpreobjecttempname%29%2C%22%E5%BF%A0%E5%B7%9E%E5%BA%9C%E5%85%AC%E7%AB%8B%E5%B0%8F%E5%AD%B8%E6%A0%A1%22+%29+%7C%7C+regex%28+str%28%3Fpreobjecttempname+%29%2C%22%E5%BF%A0%E6%B7%B8%E5%8C%97%E9%81%93%E8%A7%80%E5%AF%9F%E5%BA%9C%E5%85%AC%E7%AB%8B%E5%B0%8F%E5%AD%B8%E6%A0%A1%22+%29+%7C%7C+regex%28+str%28%3Fpreobjecttempname%29%2C%22%E5%85%AC%E7%AB%8B%E5%BF%A0%E5%B7%9E%E6%99%AE%E9%80%9A%E5%AD%B8%E6%A0%A1%22+%29+%29%0D%0A%3Feventtemp+schoolsys%3AhasTimeValue+%3Ftime.%0D%0A%7D+order+by+%3Ftime%0D%0A&format=text%2Fhtml&timeout=0&debug=on 결과보기]
 +
 +
  
  

2017년 6월 22일 (목) 15:33 판

// 모든 조직의 이름을 알고 싶다.

// 조직(학교) 이름을 모두 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select * 
where {
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schoolname
}

결과보기


// 조직의 한글이름을 역순 정렬로 보고 싶다.

// 한글로 된 조직(학교) 이름을 모두 순차정렬로 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select * 
where {
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schoolname
FILTER(LANGMATCHES(LANG(?schoolname), "ko-hangul"))
} order by ?schoolname

결과보기



// 조직의 한자이름을 역순 정렬로 보고 싶다.

// 한자로 된 조직(학교) 이름을 모두 역순정렬로 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select * 
where {
?schooltemp  rdf:type schoolsys:Group .
?schooltemp  rdfs:label ?schoolname
FILTER(LANGMATCHES(LANG(?schoolname), "ko-hanza"))
} order by desc(?schoolname)

결과보기


// "영암"에 관련된 조직의 이름을 알고 싶다.

// 한글로 된 "영암"이 포함된 조직 이름을 모두 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select * 
where {
?schooltemp  rdf:type schoolsys:Group .
?schooltemp  rdfs:label ?schoolname 
FILTER regex( str(?schoolname),"영암" )
FILTER(LANGMATCHES(LANG(?schoolname), "ko-hangul"))
}

결과보기


// "영암" 혹은 "수원"에 관련된 조직의 이름을 알고 싶다.

// 한글로 된 "영암" 혹은 "수원"이 포함된 조직 이름을 모두 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select * 
where {
?schooltemp  rdf:type schoolsys:Group .
?schooltemp  rdfs:label ?schoolname .
FILTER (regex( str(?schoolname),"영암" ) || regex( str(?schoolname),"수원" ))
FILTER(LANGMATCHES(LANG(?schoolname), "ko-hangul"))
}

결과보기


// 보통학교의 목록이 보고 싶다.

// 분류가 보통학교인 학교의 한글 이름을 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select ?schoolname ?subjectname
where {
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schoolname .
FILTER(LANGMATCHES(LANG(?schoolname), "ko-hangul"))
?schooltemp rdf:subject ?subjecttemp .
?subjecttemp rdfs:label ?subjectname .
FILTER regex( str(?subjectname),"보통학교" )
}

결과보기


// 조직의 이름을 "한글이름(한자이름)"의 형식으로 보고 싶다.

// 조직의 한글이름과 한자이름을 합쳐서 "한글이름(한자이름)"의 형식으로 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select ?schoolnamehan  ?schoolnamehanza  ?schoolname
where {
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schoolnamehan .
FILTER(LANGMATCHES(LANG(?schoolnamehan ), "ko-hangul"))
?schooltemp rdfs:label ?schoolnamehanza .
FILTER(LANGMATCHES(LANG(?schoolnamehanza ), "ko-hanza"))
BIND (CONCAT(?schoolnamehan , "(", ?schoolnamehanza, ")" ) AS ?schoolname)
}

결과보기



// 원영의(元泳義)의 인사 기록을 보고 싶다.

// 원영의(元泳義)의 소속학교, 인사운용양태, 인사운용시간, 인사운용출처를 시간 순서대로 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?eventtemp ?persontempname ?eventtypetempname ?schooltempname ?time ?webre 
where {
?persontemp rdf:type schoolsys:Person .
?persontemp rdfs:label ?persontempname 
FILTER regex( str(?persontempname ),"元泳義" )
?eventtemp schoolsys:hasEventObject ?persontemp .
?eventtemp schoolsys:hasEventType ?eventtypetemp .
?eventtypetemp rdfs:label ?eventtypetempname .
FILTER(LANGMATCHES(LANG(?eventtypetempname ), "ko-hanza"))
?eventtemp schoolsys:hasEventPostObject ?schooltemp .
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schooltempname .
FILTER(LANGMATCHES(LANG(?schooltempname ), "ko-hanza"))
?eventtemp schoolsys:hasTimeValue ?time .
?eventtemp schoolsys:hasWebResource ?webre .
} order by ?time

결과보기



// 충주부공립소학교의 인사기록을 보고 싶다.

// 충주부공립소학교의 직원명, 인사운용양태, 인사운용시간를 시간 순서대로 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?time ?persontempname ?preobjecttempname ?eventtypetempname ?postobjecttempname 
where {
?eventtemp rdf:type kyujanggak:Event.
?eventtemp schoolsys:hasEventObject ?persontemp .
?persontemp rdf:type schoolsys:Person .
?persontemp rdfs:label ?persontempname .
FILTER(LANGMATCHES(LANG(?persontempname ), "ko-hanza"))
?eventtemp schoolsys:hasEventType ?eventtypetemp .
?eventtypetemp rdfs:label ?eventtypetempname .
FILTER(LANGMATCHES(LANG(?eventtypetempname ), "ko-hanza"))
OPTIONAL {?eventtemp schoolsys:hasEventPostObject ?postobjecttemp .
?postobjecttemp rdf:type schoolsys:Group .
?postobjecttemp rdfs:label ?postobjecttempname.
FILTER(LANGMATCHES(LANG(?postobjecttempname), "ko-hanza"))}
OPTIONAL {?eventtemp schoolsys:hasEventPreObject ?preobjecttemp .
?preobjecttemp rdf:type schoolsys:Group .
?preobjecttemp rdfs:label ?preobjecttempname .
FILTER(LANGMATCHES(LANG(?preobjecttempname ), "ko-hanza"))}
FILTER ( regex( str(?postobjecttempname),"忠州府公立小學校" ) || regex( str(?postobjecttempname),"忠淸北道觀察府公立小學校" ) || regex( str(?postobjecttempname),"公立忠州普通學校" ) || regex( str(?preobjecttempname),"忠州府公立小學校" ) || regex( str(?preobjecttempname ),"忠淸北道觀察府公立小學校" ) || regex( str(?preobjecttempname),"公立忠州普通學校" ) )
?eventtemp schoolsys:hasTimeValue ?time.
} order by ?time

결과보기



// 각각의 기관은 몇 개나 있는가?

// 기관 분류별 개수 통계 출력

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select (count(distinct *) AS ?CNT) ?subjectname 
where {
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schoolname .
FILTER(LANGMATCHES(LANG(?schoolname), "ko-hangul"))
?schooltemp rdf:subject ?subjecttemp .
?subjecttemp rdfs:label ?subjectname .
} group by ?subjectname

결과보기


// 교원의 보직 이동은 어떤 학교에서 어떤 학교로 이루어졌는가?

// 보직이동에 관하여 "이전조직", "이후조직", "시간정보", "출처정보"를 출력하라

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select ?preschool ?postschool ?time ?webre
where {
?eventtemp rdf:type kyujanggak:Event.
 
?eventtemp schoolsys:hasEventPreObject ?preobjecttemp .
?preobjecttemp rdf:type schoolsys:Group .
?preobjecttemp rdfs:label ?preschool.
FILTER(LANGMATCHES(LANG(?preschool), "ko-hangul"))
 
?eventtemp schoolsys:hasEventPostObject ?postobjecttemp .
?postobjecttemp rdf:type schoolsys:Group .
?postobjecttemp rdfs:label ?postschool.
FILTER(LANGMATCHES(LANG(?postschool), "ko-hangul"))
 
?eventtemp schoolsys:hasEventType <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#C_PM_0001> . 
 
?eventtemp schoolsys:hasTimeValue ?time .
?eventtemp schoolsys:hasWebResource ?webre .
}

결과보기



// 1902년 1월 21일 이후의 교원의 보직 이동은 어떤 학교에서 어떤 학교로 이루어졌는가?

// 1902년 1월 21일 이후의 보직이동에 관하여 "이전조직", "이후조직", "시간정보"를 출력하라

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select ?preschool ?postschool ?time
where {
?eventtemp rdf:type kyujanggak:Event.

?eventtemp schoolsys:hasEventPreObject ?preobjecttemp .
?preobjecttemp rdf:type schoolsys:Group .
?preobjecttemp rdfs:label ?preschool.
FILTER(LANGMATCHES(LANG(?preschool), "ko-hangul"))

?eventtemp schoolsys:hasEventPostObject ?postobjecttemp .
?postobjecttemp rdf:type schoolsys:Group .
?postobjecttemp rdfs:label ?postschool.
FILTER(LANGMATCHES(LANG(?postschool), "ko-hangul"))

?eventtemp schoolsys:hasEventType <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#C_PM_0001> . 

?eventtemp schoolsys:hasTimeValue ?time .
FILTER ( ?time > "1902-01-21T09:00:00+09:00"^^xsd:dateTime )
}

결과보기



// 1902년 1월 21일 이후부터 1905년 10월 17일사이에 교원의 보직 이동은 어떤 학교에서 어떤 학교로 이루어졌는가?

// 1902년 1월 21일 이후부터 1905년 10월 17일사이의 보직이동에 관하여 "이전조직", "이후조직", "시간정보"를 출력하라

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select ?preschool ?postschool ?time
where {
?eventtemp rdf:type kyujanggak:Event.

?eventtemp schoolsys:hasEventPreObject ?preobjecttemp .
?preobjecttemp rdf:type schoolsys:Group .
?preobjecttemp rdfs:label ?preschool.
FILTER(LANGMATCHES(LANG(?preschool), "ko-hangul"))

?eventtemp schoolsys:hasEventPostObject ?postobjecttemp .
?postobjecttemp rdf:type schoolsys:Group .
?postobjecttemp rdfs:label ?postschool.
FILTER(LANGMATCHES(LANG(?postschool), "ko-hangul"))

?eventtemp schoolsys:hasEventType <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#C_PM_0001> . 

?eventtemp schoolsys:hasTimeValue ?time .
FILTER ( ?time > "1902-01-21T09:00:00+09:00"^^xsd:dateTime )
FILTER ( ?time < "1905-10-17T09:00:00+09:00"^^xsd:dateTime )
}

결과보기



// 의원면직자의 숫자는 시기별로 어떻게 변화하였는가?

// 시기별 의원면직자수 통계표를 추출하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select (count(distinct *) AS ?CNT) ?time
where {
?eventtemp rdf:type kyujanggak:Event.
 
?eventtemp schoolsys:hasEventObject ?objecttemp .
?objecttemp rdf:type schoolsys:Person .
?objecttemp rdfs:label ?personobj.
FILTER(LANGMATCHES(LANG(?personobj), "ko-hanza"))

?eventtemp schoolsys:hasEventType <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#C_PM_0006> . 
?eventtemp schoolsys:hasTimeValue ?time

} group by ?time

결과보기



// 의원면직자의 숫자는 연도별로 어떻게 변화하였는가?

// 연도별 의원면직자수 통계표를 추출하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select (count(distinct *) AS ?CNT) ?time
where {
?eventtemp rdf:type kyujanggak:Event.
 
?eventtemp schoolsys:hasEventObject ?objecttemp .
?objecttemp rdf:type schoolsys:Person .
?objecttemp rdfs:label ?personobj.
FILTER(LANGMATCHES(LANG(?personobj), "ko-hanza"))

?eventtemp schoolsys:hasEventType <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#C_PM_0006> . 
?eventtemp schoolsys:hasTimeValue ?timee .
bind(year(?timee) as ?time) . 

} group by ?time

결과보기



// 관립교통보통학교는 현재 서울시의 어떤 초등학교인가?

// 서울시LOD와 연계하여 관립교동보통학교에서 승계된 현재 학교의 한글, 영어, 중국어 이름을 출력하라.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX seoul: <http://lod.seoul.go.kr/ontology/>
 
SELECT ?seoulschoolname
WHERE { <http://dh.aks.ac.kr/ddokbaro#G_school_000024> schoolsys:hasCurrentSchool ?nametemp
 SERVICE <http://lod.seoul.go.kr/sparql/> {
   ?nametemp  rdfs:label ?seoulschoolname
}
}

결과보기



// 구한말 학교의 위치는 어디인가?

// 구한말 학교의 시기별 경위도 좌표를 출력하시오.

PREFIX schoolsys: <http://dh.aks.ac.kr/ontologies/personnelmatters/schoolsystem#>
PREFIX historygokr: <http://dh.aks.ac.kr/ontologies/personnelmatters/historygokr#>
PREFIX kyujanggak: <http://dh.aks.ac.kr/ontologies/personnelmatters/kyujanggak#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX seoul: <http://lod.seoul.go.kr/ontology/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
 
SELECT ?schoollabel ?lat ?long ?time
WHERE { 
?eventtemp rdf:type schoolsys:Event .
?eventtemp schoolsys:hasEventType ?ettemp .
?ettemp rdfs:label ?ettempname .
FILTER regex( str(?ettempname ),"경위도좌표" )

?eventtemp schoolsys:hasEventObject ?schooltemp .
?schooltemp rdf:type schoolsys:Group .
?schooltemp rdfs:label ?schoollabel .
FILTER(LANGMATCHES(LANG(?schoollabel), "ko-hangul"))

?eventtemp geo:lat ?lat .
?eventtemp geo:long ?long .
?eventtemp schoolsys:hasTimeValue ?time
}

결과보기