LinguaLibre

Difference between revisions of "Records"

Line 1: Line 1:
 
<query record="item" recordLabel="transcription" locutorLabel="locuteur" languageLabel="langue" languageLevelLabel="Niveau de langue">
 
<query record="item" recordLabel="transcription" locutorLabel="locuteur" languageLabel="langue" languageLevelLabel="Niveau de langue">
     select distinct ?record ?recordLabel ?locutorLabel ?languageLabel (if( ?languageLevel = entity:Q5, '???', ?languageLevelLabel ) as ?levelLabel)
+
     select distinct ?record ?recordLabel ?locutorLabel (if( ?language = entity:Q4, '???', ?languageLabel ) as ?langLabel) (if( ?languageLevel = entity:Q5 || !BOUND(?languageLevel), '???', ?languageLevelLabel ) as ?levelLabel)
 
     where {
 
     where {
 
         ?record prop:P2 entity:Q2 .
 
         ?record prop:P2 entity:Q2 .
 
         ?record prop:P5 ?locutor .
 
         ?record prop:P5 ?locutor .
 
         #extra:{"type": "wikibase-item", "filter":"Q3", "label": "P5", "multiple": true} ?record prop:P5 entity:[EXTRA] .
 
         #extra:{"type": "wikibase-item", "filter":"Q3", "label": "P5", "multiple": true} ?record prop:P5 entity:[EXTRA] .
         ?record prop:P4 ?language .
+
         ?record prop:P4 ?lang .
 
         #extra:{"type": "wikibase-item", "filter":"Q4", "label": "P4", "multiple": true} ?record prop:P4 entity:[EXTRA] .
 
         #extra:{"type": "wikibase-item", "filter":"Q4", "label": "P4", "multiple": true} ?record prop:P4 entity:[EXTRA] .
 +
        BIND( IF( isBLANK(?lang), entity:Q4, ?lang ) as ?language ).
  
        ?locutor llp:P4 ?languageStatement .
 
        ?languageStatement llv:P4 ?language .
 
        ?languageStatement llq:P13 ?level .
 
        BIND( IF( isBLANK(?level), entity:Q5, ?level ) as ?languageLevel ).
 
        #extra:{"type": "wikibase-item", "filter":"Q5", "label": "P13", "multiple": true} ?languageStatement llq:P13 entity:[EXTRA] .
 
  
 +
      OPTIONAL {
 +
 +
          ?locutor llp:P4 ?languageStatement .
 +
          ?languageStatement llv:P4 ?language .
 +
          ?languageStatement llq:P13 ?level .
 +
          #extra:{"type": "wikibase-item", "filter":"Q5", "label": "P13", "multiple": true} ?languageStatement llq:P13 entity:[EXTRA] .
 +
          BIND( IF( isBLANK(?level), entity:Q5, ?level ) as ?languageLevel ).
 +
}
 +
         
 
         ?record prop:P8 ?transcription.
 
         ?record prop:P8 ?transcription.
 
         #extra:{"type": "string", "label": "P8"}  filter contains(lcase(?transcription), lcase('[EXTRA]')).
 
         #extra:{"type": "string", "label": "P8"}  filter contains(lcase(?transcription), lcase('[EXTRA]')).

Revision as of 15:13, 11 April 2018

... Loading ...