문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자.
=== Semantic MediaWiki 고급 기능 사용법 === Semantic MediaWiki(SMW)는 MediaWiki에 시맨틱(의미론적) 기능을 추가하는 강력한 확장 기능입니다. ====시맨틱 속성(Properties) 고급 사용==== ### 사용자 정의 속성 타입 생성 <source lang=python> [[Has type::Page| ]] <!-- 페이지 타입 --> [[Has date::2023-10-05| ]] <!-- 날짜 타입 --> [[Has number::42| ]] <!-- 숫자 타입 --> [[Has text::Sample text| ]] <!-- 텍스트 타입 --> [[Has boolean::true| ]] <!-- 불리언 타입 --> [[Has geographic coordinate::37.5665° N, 126.9780° E| ]] <!-- 지리 좌표 --> </source> ### 속성의 하위 속성 정의 <source lang=python> [[Has subproperty of::ParentProperty| ]] </source> ====시맨틱 폼(Semantic Forms) 고급 활용==== ### 동적 필드 로드 <source lang=js> // 폼 필드 동적 변경 예제 $('#template_name').change(function() { if ($(this).val() === 'Book') { $('#author_field').show(); } else { $('#author_field').hide(); } }); </source> ### 조건부 필드 <source lang=js> {{{for template|Person}}} {{{field|Is_student|input type=checkbox}}} {{{end template}}} {{{if Is_student|then={{{field|School_name|mandatory}}}}} </source> ====시맨틱 쿼리(Semantic Queries) 고급 기법==== ### 중첩 쿼리 <source lang=js> {{#ask:[[Category:Companies]] |?Has employee=[[Has salary::>5000]][[Has position::Manager]] |format=table }} </source> ### 시간 기반 쿼리 <source lang=js> {{#ask:[[Has date::>2020-01-01]][[Has date::<2023-12-31]] |?Has date |sort=Has date |order=desc }} </source> ====시맨틱 결과 포맷팅==== ### 사용자 정의 템플릿으로 결과 표시 <source lang=js> {{#ask:[[Category:Books]] |?Has author |?Has published date |format=template |template=BookCard |link=none |limit=5 }} </source> ### 지도에 결과 표시 <source lang=js> {{#ask:[[Category:Cities]][[Has population::>1000000]] |?Has coordinate |format=map |zoom=4 |height=500 |width=800 }} </source> ====시맨틱 규칙과 자동화==== ### 속성 변경 시 트리거 <source lang=js> // LocalSettings.php에 추가 $smwgPageSpecialProperties[] = '_CHANGEDPROP'; </source> ### 이벤트 핸들러 등록 <source lang=js> $wgHooks['SMW::SQLStore::AfterDataUpdateComplete'][] = function( $store, $semanticData, $compositePropertyTableDiff ) { // 데이터 변경 시 실행할 코드 }; </source> ====성능 최적화 기법==== ### 인덱스 추가 <source lang=sql> -- 데이터베이스에 인덱스 추가 CREATE INDEX idx_smw_prop ON smw_properties (p_id, p_title); </source> ### 캐시 설정 <source lang=js> // LocalSettings.php $smwgQueryResultCacheType = CACHE_DB; $smwgQueryResultCacheLifetime = 3600 * 24; // 24시간 </source> ====시맨틱 미디어위키 API 사용==== ### REST API 엔드포인트 <source lang=bash> curl -X GET "http://yourwiki.org/api.php?action=ask&query=[[Category:Person]]&format=json" </source> ### 스마트폰 앱 연동 <source lang=js> fetch('https://yourwiki.org/api.php?action=ask&query=[[Has status::Active]]&format=json') .then(response => response.json()) .then(data => console.log(data)); </source> ====고급 시각화==== ### 그래프 생성 <source lang=js> {{#ask:[[Category:Project]] |?Has milestone |?Has progress |format=googlebar |height=400 |width=600 }} </source> ### 타임라인 표시 <source lang=js> {{#ask:[[Category:Event]] |?Has date |?Has description |format=timeline |limit=50 }} </source> Semantic MediaWiki의 고급 기능을 활용하면 데이터를 더욱 효과적으로 관리하고 시각화할 수 있습니다. [[category:미디어위키]]
문서 저장 미리 보기 차이 보기 취소