If any of the %magics is modified in the intermediate code, then set it again when it needed
How to enable inference in Virtuoso!
For a specific SPARQL to enable inference in Virtuoso use the following statement before the prefixes in the query
DEFINE input:inference <http://dbis.ionio.gr/owl/BIBFRAME2LM>
More specificaly, in this sparql-kernel this must be defined as the first statement in the cell in the %header "line magic"
%header DEFINE input:inference <http://dbis.ionio.gr/owl/BIBFRAME2LM>
To disable reasoner in subsequent queries set header OFF option.
See Enumerate Instances cell for details.
%endpoint http://libdata.tab.ionio.gr:8890/sparql
%graph http://dbis.ionio.gr/gBF2drv
%prefix bf: <http://id.loc.gov/ontologies/bibframe/>
# %display table withtypes
%display table
%show all
%display table
# %format json
# %format JSON | N3 | any | default
# %format any
SELECT ?familyLabel COUNT(?w) AS ?NoWorks
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
# Uncomment next statement when inference is on
# ?w a bf:Work.
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily")
}
ORDER BY ?familyLabel
%header DEFINE input:inference <http://dbis.ionio.gr/owl/BIBFRAME2LM>
#prefix bf: <http://id.loc.gov/ontologies/bibframe/>
SELECT COUNT(?w) AS ?NoWorks COUNT(?i) AS ?NoInstances
WHERE {
{
?w a bf:Work
}
UNION
{
?i a bf:Instance
}
}
%header OFF
Note:</br> to see all family names run the sparql Enumerate families
%display table
SELECT (fn:replace(str(?w), "[^/]+[/#]+", "") as ?work_id) ?wl as ?work_key (fn:replace(str(?p), "[^/]+[/#]+", "") as ?property) (fn:substring-after(str(?o), "#") as ?obj)
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
# Uncomment next statement when inference is on
# ?w a bf:Work.
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "CrimePunishmentFamily"@en).
OPTIONAL{
?w rdfs:label ?wl
}
# ===
OPTIONAL{
?w ?p ?o.
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasExpression or ?p = bf:otherEdition or
?p = bf:hasPart or
?p = bf:hasInstance or ?p = bf:accompaniedBy).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
UNION
{?o a bf:Instance} UNION {?o a bf:Archival}
UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript}
UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}
}
# ===
}
ORDER BY ?w
%display table
# PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
SELECT ?p ?pLabel COUNT(?p) AS ?pInstances
#FROM <http://dbis.ionio.gr/gBF2drv>
FROM <http://dbis.ionio.gr/owl/BIBFRAME2LM>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w ?p ?o.
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}.
OPTIONAL {?p rdfs:label ?pLabel}
}
ORDER By ?p
SELECT ?familyLabel ?p ?pLabel COUNT(?p) AS ?pInstances
# SELECT ?familyLabel STRAFTER(?p, "ontologies") ?pLabel COUNT(?p)
FROM <http://dbis.ionio.gr/owl/BIBFRAME2LM>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w ?p ?o.
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}.
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily")
OPTIONAL {?p rdfs:label ?pLabel}
}
ORDER By ?familyLabel ?p
%display table
SELECT ?p ?pLabel COUNT(?p) AS ?pInstances
FROM <http://dbis.ionio.gr/owl/BIBFRAME2LM>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w ?p ?o.
FILTER EXISTS {
{?o a bf:Instance} UNION {?o a bf:Archival} UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript} UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}.
OPTIONAL {?p rdfs:label ?pLabel}
}
ORDER By ?p
%display table
SELECT ?p ?pLabel COUNT(?p) AS ?pInstances
FROM <http://dbis.ionio.gr/owl/BIBFRAME2LM>
WHERE {
{?i a bf:Instance} UNION {?i a bf:Archival} UNION
{?i a bf:Electronic} UNION {?i a bf:Manuscript} UNION
{?i a bf:Print} UNION {?i a bf:Tactile}
?i ?p ?w.
FILTER EXISTS {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
}.
OPTIONAL {?p rdfs:label ?pLabel}
}
ORDER By ?p
%display table
SELECT ?p ?pLabel COUNT(?p) AS ?pInstances
FROM <http://dbis.ionio.gr/owl/BIBFRAME2LM>
WHERE {
{?i a bf:Instance} UNION {?i a bf:Archival} UNION
{?i a bf:Electronic} UNION {?i a bf:Manuscript} UNION
{?i a bf:Print} UNION {?i a bf:Tactile}
?i ?p ?i1.
FILTER EXISTS {
{?i1 a bf:Instance} UNION {?i1 a bf:Archival} UNION
{?i1 a bf:Electronic} UNION {?i1 a bf:Manuscript} UNION
{?i1 a bf:Print} UNION {?i1 a bf:Tactile}
}.
OPTIONAL {?p rdfs:label ?pLabel}
}
ORDER By ?p
SELECT ?p ?pLabel COUNT(?p) AS ?pInstances
FROM <http://dbis.ionio.gr/owl/BIBFRAME2LM>
WHERE {
{
{?s a bf:Work} UNION {?s a bf:Text}
UNION
{?s a bf:Cartography} UNION {?s a bf:Audio}
UNION
{?s a bf:NotatedMusic} UNION {?s a bf:NotatedMovement}
UNION
{?s a bf:Dataset} UNION {?s a bf:StillImage}
UNION
{?s a bf:MovingImage} UNION {?s a bf:Object}
UNION
{?s a bf:Multimedia} UNION {?s a bf:MixedMaterial}
?s ?p ?o.
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}.
}
UNION
# w - i
{
{?s a bf:Work} UNION {?s a bf:Text}
UNION
{?s a bf:Cartography} UNION {?s a bf:Audio}
UNION
{?s a bf:NotatedMusic} UNION {?s a bf:NotatedMovement}
UNION
{?s a bf:Dataset} UNION {?s a bf:StillImage}
UNION
{?s a bf:MovingImage} UNION {?s a bf:Object}
UNION
{?s a bf:Multimedia} UNION {?s a bf:MixedMaterial}
?s ?p ?o.
FILTER EXISTS {
{?o a bf:Instance} UNION {?o a bf:Archival} UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript} UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}.
}
UNION
# i - w
{
{?s a bf:Instance} UNION {?s a bf:Archival} UNION
{?s a bf:Electronic} UNION {?s a bf:Manuscript} UNION
{?s a bf:Print} UNION {?s a bf:Tactile}
?s ?p ?o.
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}.
}
UNION
# i - i
{
{?s a bf:Instance} UNION {?s a bf:Archival} UNION
{?s a bf:Electronic} UNION {?s a bf:Manuscript} UNION
{?s a bf:Print} UNION {?s a bf:Tactile}
?s ?p ?o.
FILTER EXISTS {
{?o a bf:Instance} UNION {?o a bf:Archival} UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript} UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}.
}
OPTIONAL {?p rdfs:label ?pLabel}
}
ORDER By ?p
%display diagram
CONSTRUCT{
?w ?p ?o.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w ?p ?o.
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasExpression or ?p = bf:otherEdition or
# ?p = bf:hasPart or
?p = bf:hasInstance or ?p = bf:accompaniedBy).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
}
Note:</br>
to see all family names run the sparql Enumerate families
%display diagram svg withliterals
%lang en
# %display diagram png
# %outfile CrimePunishmentFamily.png
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "CienAnosSoledadFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "CrimePunishmentFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "DonQuijoteFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "FaustFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "IliadFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "KaramazovBrothersFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "MadameBovaryFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "OdysseyFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "ScarletLetterFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "TomSawyerFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram svg withliterals
%lang en
CONSTRUCT{
?w ?p ?o.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "WutheringHeightsFamily"@en).
?w ?p ?o.
# comment not desired properties
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasPart or
?p = bf:hasExpression or ?p = bf:otherEdition).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
Note:
It is meaningless for a query to try to select also Instance 2 Instance relationships in this data set.
This dataset contains the following also Instance 2 Instance instances:
i | p | pLabel | i1 |
---|---|---|---|
http://dbis.ionio.gr/Resources/library#dbis_0000001467 | http://id.loc.gov/ontologies/bibframe/accompaniedBy | Accompanied by | http://dbis.ionio.gr/Resources/library#dbis_0000001470 |
http://dbis.ionio.gr/Resources/library#dbis_0000001470 | http://id.loc.gov/ontologies/bibframe/accompanies | Accompanies | http://dbis.ionio.gr/Resources/library#dbis_0000001467 |
http://dbis.ionio.gr/Resources/library#dbis_0000001431 | http://id.loc.gov/ontologies/bibframe/hasPart | Has part | http://dbis.ionio.gr/Resources/library#dbis_0000001434 |
http://dbis.ionio.gr/Resources/library#dbis_0000001434 | http://id.loc.gov/ontologies/bibframe/partOf | Is part of | http://dbis.ionio.gr/Resources/library#dbis_0000001431 |
w | c | s | l |
---|---|---|---|
http://dbis.ionio.gr/Resources/library#dbis_0000001468 | MAP TWAIN MARK 1835 1910 UNT ADVENTURES OF TOM SAWYER SELECTIONS BFTYPE (Text) LNG08-35-37eng | http://dbis.ionio.gr/Resources/library#dbis_0000001467 | 2008. Naperville, Ill. : Sourcebooks Jabberwocky, 2008. |
http://dbis.ionio.gr/Resources/library#dbis_0000001471 | MAP TWAIN MARK 1835 1910 UNT ADVENTURES OF TOM SAWYER SELECTIONS BFTYPE (Audio) LNG08-35-37eng | http://dbis.ionio.gr/Resources/library#dbis_0000001470 | 2008. Naperville, Ill. : Sourcebooks Jabberwocky, 2008. |
http://dbis.ionio.gr/Resources/library#dbis_0000000828 | MAP TWAIN MARK 1835 1910 UNT ADVENTURES OF TOM SAWYER BFTYPE (Text) LNG08-35-37eng | http://dbis.ionio.gr/Resources/library#dbis_0000001431 | 1982. Frederick, Md. : University Publications of America ; Washington, D.C. : Georgetown University Library, c1982. |
http://dbis.ionio.gr/Resources/library#dbis_0000000828 | MAP TWAIN MARK 1835 1910 UNT ADVENTURES OF TOM SAWYER BFTYPE (Text) LNG08-35-37eng | http://dbis.ionio.gr/Resources/library#dbis_0000001434 | 1876. 1876. |
to see all family names run the sparql Enumerate families
%display diagram
CONSTRUCT{
?w ?p ?o.
?o ?p1 ?o1.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
# w - w
# w - i
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w ?p ?o.
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasExpression or ?p = bf:otherEdition or
?p = bf:hasPart or
?p = bf:hasInstance or ?p = bf:accompaniedBy).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
UNION
{?o a bf:Instance} UNION {?o a bf:Archival}
UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript}
UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}
OPTIONAL {
?o ?p1 ?o1
FILTER EXISTS {
{?o1 a bf:Instance} UNION {?o1 a bf:Archival}
UNION
{?o1 a bf:Electronic} UNION {?o1 a bf:Manuscript}
UNION
{?o1 a bf:Print} UNION {?o1 a bf:Tactile}
}
}
}
To specify a family, set its name in statement:</br> FILTER (?ntype = "BibFamily" and ?familyLabel = "CienAnosSoledadFamily")
Note:</br>
to see all family names run the sparql Enumerate families
%display diagram
CONSTRUCT{
?w ?p ?o.
?o ?p1 ?o1.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
?o1 rdfs:label ?instanceID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
# w - w
# w - i
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "CienAnosSoledadFamily"@en).
?w ?p ?o.
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasExpression or ?p = bf:otherEdition or
?p = bf:hasPart or
?p = bf:hasInstance or ?p = bf:accompaniedBy).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
UNION
{?o a bf:Instance} UNION {?o a bf:Archival}
UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript}
UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}
OPTIONAL {
?o ?p1 ?o1
FILTER EXISTS {
{?o1 a bf:Instance} UNION {?o1 a bf:Archival}
UNION
{?o1 a bf:Electronic} UNION {?o1 a bf:Manuscript}
UNION
{?o1 a bf:Print} UNION {?o1 a bf:Tactile}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o1 rdfs:label ?instanceID.
# ?w bf:code ?workID. # Alternative information to used as matching key
}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
%display diagram
CONSTRUCT{
?w ?p ?o.
?o ?p1 ?o1.
?w rdfs:label ?workID.
?o rdfs:label ?oID.
?o1 rdfs:label ?instanceID.
# ?w bf:code ?workID.
# ?o bf:code ?oID.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
# w - w
# w - i
{?w a bf:Work} UNION {?w a bf:Text}
UNION
{?w a bf:Cartography} UNION {?w a bf:Audio}
UNION
{?w a bf:NotatedMusic} UNION {?w a bf:NotatedMovement}
UNION
{?w a bf:Dataset} UNION {?w a bf:StillImage}
UNION
{?w a bf:MovingImage} UNION {?w a bf:Object}
UNION
{?w a bf:Multimedia} UNION {?w a bf:MixedMaterial}
?w bf:note ?wf.
?wf bf:noteType ?ntype;
rdfs:label ?familyLabel.
FILTER (?ntype = "BibFamily" and ?familyLabel = "TomSawyerFamily"@en).
?w ?p ?o.
FILTER (?p = bf:translation or ?p = bf:hasDerivative or
?p = bf:hasExpression or ?p = bf:otherEdition or
?p = bf:hasPart or
?p = bf:hasInstance or ?p = bf:accompaniedBy).
FILTER EXISTS {
{?o a bf:Work} UNION {?o a bf:Text}
UNION
{?o a bf:Cartography} UNION {?o a bf:Audio}
UNION
{?o a bf:NotatedMusic} UNION {?o a bf:NotatedMovement}
UNION
{?o a bf:Dataset} UNION {?o a bf:StillImage}
UNION
{?o a bf:MovingImage} UNION {?o a bf:Object}
UNION
{?o a bf:Multimedia} UNION {?o a bf:MixedMaterial}
UNION
{?o a bf:Instance} UNION {?o a bf:Archival}
UNION
{?o a bf:Electronic} UNION {?o a bf:Manuscript}
UNION
{?o a bf:Print} UNION {?o a bf:Tactile}
}
OPTIONAL {
?o ?p1 ?o1
FILTER EXISTS {
{?o1 a bf:Instance} UNION {?o1 a bf:Archival}
UNION
{?o1 a bf:Electronic} UNION {?o1 a bf:Manuscript}
UNION
{?o1 a bf:Print} UNION {?o1 a bf:Tactile}
}
# get instances' label
OPTIONAL { # when debuggingg, use it as optional to find also works without a matching key
?o1 rdfs:label ?instanceID.
# ?w bf:code ?workID. # Alternative information to used as matching key
}
}
# get instances' label
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?w rdfs:label ?workID.
# ?w bf:code ?workID # Alternative information to used as matching key
}
OPTIONAL { # when debugging, use it as optional to find also works without a matching key
?o rdfs:label ?oID.
# ?o bf:code ?oID # Alternative information to used as matching key
}
}
# %display diagram
%display diagram svg withliterals
%lang en
CONSTRUCT{
<http://dbis.ionio.gr/Resources/library#dbis_0000001011> ?p ?o.
?o ?p1 ?o1.
?o1 ?p2 ?o2.
?o2 ?p3 ?o3.
}
FROM <http://dbis.ionio.gr/gBF2drv>
WHERE {
<http://dbis.ionio.gr/Resources/library#dbis_0000001011> ?p ?o.
FILTER (?p1 != rdf:type)
# FILTER (?p != rdfs:label)
OPTIONAL {
?o ?p1 ?o1.
FILTER (?p1 != rdf:type)
# FILTER (?p1 != rdfs:label)
OPTIONAL{
?o1 ?p2 ?o2.
FILTER (?p1 != rdf:type)
# FILTER (?p2 != rdfs:label)
OPTIONAL {
?o2 ?p3 ?o3.
FILTER (?p1 != rdf:type)
# FILTER (?p3 != rdfs:label)
}
}
}
}