Skip to content

Handling commas in form values for authors in Muvin #2

@Niteuk

Description

@Niteuk

### 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions