lundi 13 juin 2022

Is there a function that ressembles find_in_set for sparql or ARC2?

This is my first post,so I'm not sure how to ask the question ,but I have been working on a e-learning website using a classic search engin and a semantic one,I created my ontology,and used ARC2 and fuseki server, and the sparql query works when it comes to searching the keywords like I needed it to . In adition to the search engin, I'm also using a checkbox where the user can select the types of articles they wish to get for their search ,audio,video,pdf ,an image or a word file. While in classic search I used find_in_set and an array,which works perfectly,yet I don't seem to find a way when it comes to the semantic search ,this is my sparql query :

PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX  owl:  <http://www.w3.org/2002/07/owl#>
PREFIX  article: <http://127.0.0.1/Index.php/learning#>
SELECT  *
WHERE
  { ?Publication  article:HasLevel  ?niveau ;
              article:HasLanguage   ?Langue ;
              article:HasType       ?Type ; 
              article:HasDispo      article:Pub ;
              article:Timepub       ?Temps ;
              article:AnneePub      ?Annee ;
              article:AuteurPub     ?Auteur ;
              article:DescriptionPub ?Description ;
              article:FichierPub    ?Fichier ;
              article:IDPub         ?ID ;
              article:TaillePub     ?Taille ;
              article:TitrePub      ?Titre ;
              article:Unipulication  ?Universite ;
              article:PubliéPar     ?Professeur .
              ?Professeur article:NomUti ?NomProf.
              ?Professeur article:PrenomUti ?PrenomProf
  FILTER( REGEX(STR(?Titre), "'.$r.'","i") || REGEX(STR(?Description), "'.$r.'","i"))}
  ORDER BY DESC(?Temps)
  ';```
the $r is for the keyword 
Do I need to use an other way,or is there a function close to find_in_set for sparql or ARC2?



Aucun commentaire:

Enregistrer un commentaire