Advertisement
asanchez75

draft/agrovoc/skos

Jun 27th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.96 KB | None | 0 0
  1. http://lprapp14.fao.org:8090/openrdf-sesame/repositories/biotech
  2.  
  3. PREFIX skosxl:<http://www.w3.org/2008/05/skos-xl#>.
  4. PREFIX skos:<http://www.w3.org/2004/02/skos/core#>.
  5. SELECT ?uri ?xlabLit
  6. WHERE {
  7. ?termuri skos:related ?uri .
  8. ?uri skosxl:prefLabel ?xlabel .
  9. ?xlabel skosxl:literalForm ?xlabLit .
  10. FILTER ( (regex(str(?termuri), 'http://aims.fao.org/aos/biotechglossary/c_4387')) && (lang(?xlabLit)='es') )
  11. }
  12.  
  13. $agrovoc = new agrovoc_remote('http://agrovoc.fao.org/axis/services/SKOSWS', 'AgrovocWS');
  14. //dpm($agrovoc->simple_search_by_mode2('rice'));
  15. dpm($agrovoc->get_all_labels_by_termcode2('6599'));
  16. //dpm($agrovoc->getConceptByKeyword2('rice bean'));
  17.  
  18. ==================================================
  19. dc:contributor
  20. dc:coverage
  21. dc:creator
  22. dc:date
  23. dc:description
  24. dc:format
  25. dc:identifier
  26. dc:language
  27. dc:publisher
  28. dc:relation
  29. dc:rights
  30. dc:source
  31. dc:subject
  32. dc:title
  33. dc:type
  34. Raw metadata record URL
  35. Record publication date
  36. Repository Record identifier
  37. Set: setSpec (raw value)
  38. URL to resource
  39.  
  40.  
  41. EXPLAIN SELECT node.nid AS nid, node.title AS node_title, node.language AS node_language, node.created AS node_created, 'node' AS field_data_field_images_node_entity_type, 'node' AS field_data_body_node_entity_type FROM node node LEFT JOIN domain_access domain_access ON node.nid = domain_access.nid AND domain_access.realm = 'domain_id' WHERE (( (domain_access.gid = '1') AND (domain_access.realm = 'domain_id') )AND(( (node.status = '1') AND (node.type IN ('news')) AND (node.language IN ('en')) ))) ORDER BY node_created DESC LIMIT 10 OFFSET 80;
  42.  
  43.  
  44. EXPLAIN SELECT node.nid AS nid, node.title AS node_title, node.language AS node_language, node.created AS node_created, 'node' AS field_data_field_images_node_entity_type, 'node' AS field_data_body_node_entity_type FROM node node USE INDEX(node_created) LEFT JOIN domain_access domain_access ON node.nid = domain_access.nid AND domain_access.realm = 'domain_id' WHERE (( (domain_access.gid = '1') AND (domain_access.realm = 'domain_id') )AND(( (node.status = '1') AND (node.type IN ('news')) AND (node.language IN ('en')) ))) ORDER BY node_created DESC LIMIT 10 OFFSET 80;
  45.  
  46.  
  47. explain select count(*) from node_access;
  48.  
  49. ========================================================
  50.  
  51. asanchez75@python:/var/www/mhea/sites/all/themes/mhea$ drush-de media
  52. Project media (7.x-1.3) downloaded to /var/www/mhea/sites/all/modules/contrib/media. [success]
  53. Project media contains 3 modules: file_entity, media_internet, media.
  54. The following extensions will be enabled: media, file_entity
  55. Do you really want to continue? (y/n): y
  56. file_entity was enabled successfully. [ok]
  57. media was enabled successfully.
  58.  
  59. ========================================================
  60. git diff --staged --word-diff
  61. git config --global merge.tool
  62. ========================================================
  63. DNA
  64.  
  65. http://aims.fao.org/aos/biotechglossary/c_4387
  66.  
  67.  
  68. dpm(_sparql_query_getDataFromWS('DNA', 'en'));
  69.  
  70.  
  71.  
  72. dpm(
  73. _sparql_query_execute(
  74. _sparql_query_getRelatedTermsByURI('http://aims.fao.org/aos/biotechglossary/c_4387','es')
  75. )
  76. );
  77.  
  78.  
  79.  
  80. dpm(
  81. _sparql_query_execute(
  82. _sparql_query_getNameTermsByURI('DNA','es')
  83. )
  84. );
  85.  
  86.  
  87. =========================================================
  88.  
  89.  
  90. first step
  91. rice tungro spherical virus
  92. --simpleSearchByMode2
  93.  
  94. second step
  95. 34140
  96. --getConceptInfoByTermcode
  97. [[34140], [Rice tungro spherical virus,LO, rice tungro spherical virus,SK, 水稻东格鲁球形病毒,ZH, Virus sferico tungro del riso,IT, rizs tungro szférikus vírus,HU, Wirus RTSV,PL, Vírus esferiforme tungro do arroz,PT, Virus sphérique tungro du riz,FR, ويروس گرد تونگروي برنج,FA, धान टंग्रो गोलाकार विषाणु,HI, Rice tungro spherical virus,TH, rice tungro spherical virus,CS, сферический вирус риса тунгро,RU, Rice tungro spherical virus,EN, イネツングロスフェリカルウイルス,JA, Virus esférico tungro del arroz,ES, RICE TUNGRO SPHERICAL VIRUS,DE], [UF], [USE, 34138], [BT, 5985], [NT], [RT, 34137]]
  98.  
  99. third step
  100. get_all_labels_by_termcode2
  101.  
  102. ==============================================
  103.  
  104. rice bean
  105. --simpleSearchByMode2
  106. 13921
  107. --getConceptInfoByTermcode
  108. [[13921], [vigna,SK, rizsbab,HU, ถั่วเล็บมือนาง,TH, rice bean,CS, rice bean,EN, рисовая фасоль,RU, Feijão-arroz,PT, Haricot riz,FR, REISBOHNE,DE, Fríjol de arroz,ES, ツルアズキ,JA, राइस बीन्स,HI, لوبياهاي آردي,FA], [UF], [USE, 8246], [BT, 8228], [NT], [RT, 3348, 331243]]
  109. third step
  110. get_all_labels_by_termcode2
  111.  
  112. ================================================
  113. rice (plant)
  114. --simpleSearchByMode2
  115. 331295
  116. --getConceptInfoByTermcode
  117. [[331295], [rice (plant),EN], [UF], [USE, 5435], [BT, 3354], [NT, 5436, 5437, 5438, 8076, 24352, 24353, 24354, 34362], [RT, 16032, 34891, 25512, 11125]]
  118.  
  119. ================================================
  120. rice weevil
  121.  
  122. $agrovoc = new agrovoc_remote('http://agrovoc.fao.org/axis/services/SKOSWS', 'AgrovocWS');
  123. $concept = $agrovoc->getConceptByKeyword2('Agrovoc', 'rice bean');
  124. dpm($concept);
  125. include_once("/var/www/agridrupal/sites/all/libraries/arc2/ARC2.php");
  126. $base = 'http://localhost/agridrupal';
  127. $data = $concept;
  128. $parser = ARC2::getRDFParser();
  129. $parser->parse($base, $data);
  130. dpm($parser->getTriples());
  131.  
  132. ===================================================
  133. 7440 Informational No matching taxonomy term found for source value 'ecology' in vocabulary Subject Specializations.
  134. 7440 Informational No matching taxonomy term found for source value 'land cover change' in vocabulary Subject Specializations.
  135.  
  136. 7440 26029
  137.  
  138. sftp://dev.f3b74e44-32c3-45e6-a000-58efb4149b5f@appserver.dev.f3b74e44-32c3-45e6-a000-58efb4149b5f.drush.in:2222/srv/bindings/3d7472ee202a4e1fa4c0dffe07c53652/code
  139.  
  140. SELECT `node`.`title` , `node`.`nid`, `content_field_autor`.`value`
  141. FROM `content_type_publicaciones`
  142. INNER JOIN `node` ON `content_type_publicaciones`.`nid` = `node`.`nid`
  143. INNER JOIN `content_field_autor`.`nid` = `node`.`nid`
  144. WHERE `node`.`type` = 'publicaciones'
  145. AND `content_type_publicaciones`.`field_edicion_value` = '2012'
  146. LIMIT 0 , 30
  147.  
  148.  
  149.  
  150. 1. el layout
  151. 2. ayuda para contsruir queries broader, narrower y related (seach term)
  152. 3. que parametros de las consultas SPARQL creen que podrian cambiar
  153. 3.1 si usa SKOS - XL la consulta puede cambiar mucho
  154.  
  155.  
  156. 1. the term’s label in other languages
  157. 2. non-preferred terms or other term variants
  158. 3. the definition in the current language
  159. 4. Related terms in the current language (this is currently based on a search of the full set of terms in the current language against the keywords in the current term’s definition field to check for matches. Implementation team shall run such a query and explicitly build these relations into the model)
  160. 5. The clickable URI of the resource
  161.  
  162.  
  163. ===================================================
  164.  
  165. TRUNCATE TABLE `agrovocfield_index` ;
  166. TRUNCATE TABLE `taxonomy_index` ;
  167. TRUNCATE TABLE `taxonomy_term_data` ;
  168. TRUNCATE TABLE `taxonomy_term_hierarchy` ;
  169. TRUNCATE TABLE `i18n_translation_set` ;
  170.  
  171. taxonomy_field_presave
  172.  
  173. ====================================================
  174.  
  175. select distinct ?o ?coord
  176. where {
  177. ?s dbpedia-owl:country ?o .
  178. ?o georss:point ?coord .
  179. FILTER (lang(?coord) = 'en')
  180. }
  181. limit 10
  182.  
  183. ====================================================
  184.  
  185. $config['remote_store_endpoint'] = 'http://202.45.142.113:10035/repositories/agris';
  186. $store = ARC2::getRemoteStore($config);
  187. $uri =
  188. $query = _sparql_query_getRelatedTermsBySubjectURI('http://aims.fao.org/aos/agrovoc/c_35332', 'eng', 10);
  189. dpm($query);
  190. $rows = $store->query($query, 'rows');
  191.  
  192. dpm($rows);
  193.  
  194.  
  195. function _sparql_query_getRelatedTermsBySubjectURI($uri, $lang, $limit) {
  196. return
  197. "prefix bibo: <http://purl.org/ontology/bibo/>
  198. prefix dcterms: <http://purl.org/dc/terms/>
  199. select distinct ?s ?title ?uri ?lang
  200. where {
  201. ?s dcterms:title ?title .
  202. ?s dcterms:subject ?subject .
  203. ?s bibo:uri ?uri .
  204. ?s bibo:language ?lang
  205. filter ((str(?subject) = '" . $uri . "') && (str(?lang) = '" . $lang . "'))
  206. }
  207. limit " . $limit;
  208. }
  209.  
  210.  
  211. EXPLAIN SELECT t.* FROM field_data_field_publication_language t WHERE (entity_type = 'node') AND (entity_id IN ('17962', '17963', '17964', '17966', '17967', '17971', '17972')) AND (language IN ('und')) AND (deleted = '0') ORDER BY delta ASC;
  212.  
  213. EXPLAIN SELECT t.* FROM field_data_field_publication_language t USE INDEX(delta) WHERE (entity_type = 'node') AND (entity_id IN ('17962', '17963', '17964', '17966', '17967', '17971', '17972')) AND (language IN ('und')) AND (deleted = '0') ORDER BY delta ASC;
  214.  
  215.  
  216. EXPLAIN SELECT n.nid AS nid, n.status AS
  217. STATUS FROM apachesolr_index_entities_node aien
  218. INNER JOIN node n ON n.nid = aien.entity_id
  219. WHERE (
  220. aien.status <> n.status
  221. )
  222. LIMIT 1000
  223.  
  224.  
  225.  
  226. mtnorg_old
  227. geogloria
  228. bd_can
  229. template_postgis
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement