Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling commas in form values for authors in Muvin #2

Open
Niteuk opened this issue Jun 21, 2024 · 0 comments
Open

Handling commas in form values for authors in Muvin #2

Niteuk opened this issue Jun 21, 2024 · 0 comments

Comments

@Niteuk
Copy link

Niteuk commented Jun 21, 2024

### Problem:
I have encountered an issue while using Muvin with the ISSA endpoint SPARQL endpoint "https://data-issa.cirad.fr/sparql". When entering authors in the value form field in LDVIZ, Muvin uses commas as a separator. However, in the pipeline, authors are stored in the format "Michel, Franck". This causes a problem because when I enter "Michel, Franck" in the form, Muvin splits it into two separate variables ("Michel" and "Franck"), and the visualization does not work correctly.

To work around this issue, I used a temporary query by replacing the value variable(replace $value) with "Michel, Franck" directly in the query and setting a temporary value in the form in LDVIZ. This way, Muvin runs correctly and returns the expected results for the author Franck Michel. However, this approach is not practical for regular use.

### Query:

PREFIX fabio: <http://purl.org/spar/fabio/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX bibo:   <http://purl.org/ontology/bibo/>
PREFIX issa:   <http://data-issa.cirad.fr/>
PREFIX issapr: <http://data-issa.cirad.fr/property/>
PREFIX oa:     <http://www.w3.org/ns/oa#>
PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
PREFIX dct:    <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX dce:     <http://purl.org/dc/elements/1.1/>
PREFIX fabio:   <http://purl.org/spar/fabio/>


SELECT DISTINCT ?uri ?title ?date ?type ?link ?ego ?alter
WHERE {
    BIND ("Michel, Franck" AS ?ego)

    {
        ?uri dce:creator ?ego .
    }

    OPTIONAL {
        ?uri dce:creator ?alter .
        FILTER (?alter != ?ego) 
    }

    ?uri dct:title ?title ;
         dct:issued ?date ;
         schema:url ?link ;
         a ?documentType .

    # Déterminer le type de document
  BIND (IF (?documentType = fabio:ResearchPaper, "Article",
  			IF (?documentType = fabio:Expression, "Monograph",
        		IF (?documentType = fabio:StillImage, "Map",
        			IF (?documentType = fabio:Book, "Book",
          				IF (?documentType = fabio:BookChapter, "Book Section",
            				IF (?documentType = fabio:ConferencePaper, "Conference Article","Other")))))) AS ?type)
} LIMIT 10 OFFSET $offset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant