herminiogg / ShExML

A heterogeneous data mapping language based on Shape Expressions
http://shexml.herminiogarcia.com
MIT License
15 stars 2 forks source link

Fix generation of shape map when white spaces are present #87

Closed herminiogg closed 3 years ago

herminiogg commented 3 years ago

Example:

PREFIX : <http://example.com/>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX schema: <http://schema.org/>
SOURCE films_xml_file <http://shexml.herminiogarcia.com/files/films.xml>
ITERATOR film_xml <xpath: //film> {
    FIELD id <@id>
    FIELD name <name>
    FIELD year <year>
    FIELD country <country>
    FIELD directors <crew/directors/director>
    FIELD screenwritters <crew//screenwritter>
    FIELD music <crew/music>
    FIELD photography <crew/photography>
    ITERATOR actors <cast/actor> {
        FIELD name <name>
        FIELD role <role>
        FIELD film <../../@id>
    }
    ITERATOR actresses <cast/actress> {
        FIELD name <name>
        FIELD role <role>
        FIELD film <../../@id>
    }
}
EXPRESSION films <films_xml_file.film_xml>

:Films :[films.id] {
    schema:name [films.name] ;
    :year dbr:[films.year] ;
    schema:countryOfOrigin dbr:[films.country] ;
    schema:director dbr:[films.directors] ;
    :screenwritter dbr:[films.screenwritters] ;
    schema:musicBy dbr:[films.music] ;
    :cinematographer dbr:[films.photography] ;
    schema:actor @:Actor ;
    schema:actor @:Actress ;
}

:Actor dbr:[films.actors.name] {
    :name [films.actors.name] ;
    :appear_on :[films.actors.film] ;
}

:Actress dbr:[films.actresses.name] {
    :name [films.actresses.name] ;
    :appear_on :[films.actresses.film] ;
}