#query main prefix olp: prefix dc: prefix frbr: prefix foaf: prefix bibo: prefix rev: prefix tag: prefix rdf: prefix rdfs: prefix vocab: CONSTRUCT { ?work a frbr:Work ; dc:title ?title ; frbr:realization ?edition ; rev:hasReview ?bookReview . ?edition a frbr:Expression ; bibo:isbn ?isbn ; frbr:realizationOf ?work ; rev:hasReview ?editionReview ; olp:hasTagging ?tagging ; olp:hasDescription ?description . ?user a foaf:Person ; foaf:givenName ?userGivenName ; foaf:familyName ?userLastName ; olp:hasWritten ?description ; olp:hasWritten ?review ; olp:hasMadeTagging ?tagging . ?tagging a tag:Tagging ; tag:taggedResource ?edition ; tag:taggedBy ?user ; tag:associatedTag ?tag . ?tag a tag:Tag ; olp:associatedTagging ?tagging ; tag:name ?tagName . ?description a olp:Description ; olp:describes ?edition ; olp:hasText ?descriptionText ; olp:writtenBy ?user . ?bookReview a rev:Review ; rev:rating ?rating ; rev:reviewer ?user ; olp:reviews ?work ; rev:title ?reviewHeader ; rev:text ?reviewText . ?editionReview a rev:Review ; rev:rating ?rating ; rev:reviewer ?user ; olp:reviews ?edition ; rev:title ?reviewHeader ; rev:text ?reviewText . } WHERE { OPTIONAL { ?tagging vocab:taggings_tag_id ?tagId ; vocab:taggings_user_id ?userId ; { ?tagging vocab:taggings_book_id ?workId . } UNION { ?tagging vocab:taggings_edition_id ?editionId . } ?tag vocab:tags_id ?tagId ; vocab:tags_name ?tagName . } OPTIONAL { ?description vocab:descriptions_edition_id ?editionId ; vocab:descriptions_text ?descriptionText . OPTIONAL { ?description vocab:descriptions_user_id ?userId . } } OPTIONAL { ?editionReview vocab:assessments_id ?assessmentId ; vocab:assessments_grade ?rating ; vocab:assessments_user_id ?userId ; vocab:assessments_edition_id ?editionId ; vocab:assessments_comment_header ?reviewHeader ; vocab:assessments_comment_text ?reviewText . } OPTIONAL { ?bookReview vocab:assessments_id ?assessmentId ; vocab:assessments_grade ?rating ; vocab:assessments_user_id ?userId ; vocab:assessments_book_id ?workId ; vocab:assessments_comment_header ?reviewHeader ; vocab:assessments_comment_text ?reviewText . FILTER (!bound(?editionReview)) } OPTIONAL { ?user vocab:users_id ?userId . OPTIONAL { ?user vocab:users_firstname ?userGivenName ; vocab:users_lastname ?userLastName . } } OPTIONAL { ?edition vocab:editions_isbn ?isbn ; vocab:editions_id ?editionId ; vocab:editions_book_id ?workId . } { ?work vocab:books_id ?workId ; vocab:books_title ?title . } FILTER (regex(?isbn, "^([0-9X][- /.]?){10,10}$", "i") || regex(?isbn, "^([0-9X][- /.]?){13,13}$", "i") ) } #end