Lists the roles assigned in a given space as a table: each role (linked, labelled by its schema:name, falling back to its label/title), its tier (Admin/Maintainer/Member/Observer), a count of how many distinct users of the space hold that role, the contributing preset (via_preset, for roles carried by an active preset assignment), who added it, and the date. The built-in Admin role is always included as the first row. Also returns the role-assignment template (for the assign-user action) and the source nanopublication.
List space roles
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?role
(sample(?rlbl) as ?role_label)
(sample(?rtier) as ?tier)
(count(distinct ?member) as ?users)
(sample(?presetX) as ?via_preset)
(sample(?presetXlbl) as ?via_preset_label)
(sample(?userX) as ?added_by)
(max(?dateX) as ?date_added)
(sample(?rtmpl) as ?roleAssignmentTemplate)
(sample(?npX) as ?np)
where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
values ?_space_multi_iri {}
{
bind(<https://w3id.org/np/RA_eEJjQbxzSqYSwPzfjzOZi5sMPpUmHskFNsgJYSws8I/adminRole> as ?role)
bind(0 as ?sortkey)
bind("admin" as ?rlbl)
bind("Admin" as ?rtier)
bind(<https://w3id.org/np/RAsOQ7k3GNnuUqZuLm57PWwWopQJR_4onnCpNR457CZg8> as ?rtmpl)
bind(gen:hasAdmin as ?prop)
} union {
graph ?g {
?ra a gen:RoleAssignment ; npa:forSpace ?_space_multi_iri ; gen:hasRole ?role ; npa:viaNanopub ?npX .
}
graph npa:graph { ?npX dct:created ?dateX . }
optional { graph npa:graph { ?npX npx:signedBy ?userX . } }
bind(1 as ?sortkey)
graph npa:spacesGraph {
?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np .
}
bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MaintainerRole } } as ?isMaintainer)
bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MemberRole } } as ?isMember)
bind(if(?isMaintainer,"Maintainer",if(?isMember,"Member","Observer")) as ?rtier)
graph npa:graph { ?role_np np:hasAssertion ?role_a . }
optional { graph ?role_a { ?role rdfs:label ?rl1 } }
optional { graph ?role_a { ?role dct:title ?rt1 } }
optional { graph ?role_a { ?role schema:name ?rn1 } }
optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?rtmpl } }
bind(coalesce(?rn1, ?rl1, ?rt1) as ?rlbl)
optional {
{ graph npa:spacesGraph { ?roleDecl gen:hasRegularProperty ?prop } }
union
{ graph npa:spacesGraph { ?roleDecl gen:hasInverseProperty ?prop } }
}
} union {
{
select ?role ?presetX ?presetXlbl ?userX ?npX ?dateX ?pubkeyA ?_space_multi_iri {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> {
graph npa:graph {
?npX npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkeyA ;
dct:created ?dateX ;
npx:embeds ?assignment ;
np:hasAssertion ?aX .
filter not exists { ?invX npx:invalidates ?npX ; npa:hasValidSignatureForPublicKeyHash ?pubkeyA . }
optional { ?npX npx:signedBy ?userX }
}
graph ?aX {
?assignment gen:isAssignmentFor ?_space_multi_iri ;
gen:isAssignmentOfPreset ?presetX .
optional {
values ?mX { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }
?assignment a ?mX .
}
}
filter(!bound(?mX) || !contains(str(?mX), "Deactivated"))
filter not exists {
graph npa:graph {
?np2 npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;
dct:created ?date2 ;
npx:embeds ?assignment2 ;
np:hasAssertion ?a2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
}
graph ?a2 {
?assignment2 a gen:DeactivatedPresetAssignment ;
gen:isAssignmentFor ?_space_multi_iri ;
gen:isAssignmentOfPreset ?presetX .
}
filter(?date2 > ?dateX)
}
graph npa:graph { ?presetNp npx:embeds ?presetX ; np:hasAssertion ?paX . }
graph ?paX {
?presetX a gen:Preset .
optional { ?presetX rdfs:label ?presetXlbl . }
?presetX gen:hasRole ?role .
}
}
}
}
graph ?g {
?riA a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?authAgent ;
(npa:inverseProperty|npa:regularProperty) ?rolePropA .
?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkeyA .
}
optional {
graph npa:spacesGraph {
?rdA a npa:RoleDeclaration ; npa:forSpace ?_space_multi_iri ;
npa:hasRoleType gen:MaintainerRole ;
(npa:inverseProperty|npa:regularProperty) ?rolePropA .
bind(true as ?isMaintA)
}
}
filter(?rolePropA = gen:hasAdmin || bound(?isMaintA))
bind(1 as ?sortkey)
graph npa:spacesGraph {
?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np .
}
bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MaintainerRole } } as ?isMaintainer)
bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MemberRole } } as ?isMember)
bind(if(?isMaintainer,"Maintainer",if(?isMember,"Member","Observer")) as ?rtier)
graph npa:graph { ?role_np np:hasAssertion ?role_a . }
optional { graph ?role_a { ?role rdfs:label ?rl1 } }
optional { graph ?role_a { ?role dct:title ?rt1 } }
optional { graph ?role_a { ?role schema:name ?rn1 } }
optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?rtmpl } }
bind(coalesce(?rn1, ?rl1, ?rt1) as ?rlbl)
optional {
{ graph npa:spacesGraph { ?roleDecl gen:hasRegularProperty ?prop } }
union
{ graph npa:spacesGraph { ?roleDecl gen:hasInverseProperty ?prop } }
}
}
optional {
graph ?g {
?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?member .
}
optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropS } }
optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropX } }
bind(coalesce(?riPropS, ?riPropX) as ?riProp)
filter(bound(?prop) && ?riProp = ?prop)
}
}
group by ?role ?sortkey
order by ?sortkey desc(max(?dateX))
Lists the currently active presets assigned to a resource, for the About page, filtered to assignments signed by an admin or maintainer of the owning space, or by the affected user themselves; deactivated assignments (and assignments with a newer deactivation for the same pair) are excluded. Shows each assigned preset, who added it, the date, and the source nanopub. The deactivatePreset column feeds the per-row deactivate action.
List preset assignments
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?preset ?preset_label
(str(?preset) as ?deactivatePreset)
(?user as ?added_by) (?date as ?date_added)
?np ("^" as ?np_label) where {
values ?_resource_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
{
graph ?stateG {
?_resource_multi_iri npa:isMaintainedBy? ?space .
?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .
}
optional {
graph npa:spacesGraph {
?rd a npa:RoleDeclaration ; npa:forSpace ?space ;
npa:hasRoleType gen:MaintainerRole ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
bind(true as ?isMaintainer)
}
}
filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))
} union {
graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }
}
}
graph npa:graph {
?np npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey ;
dct:created ?date ;
npx:embeds ?assignment ;
np:hasAssertion ?a .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
optional { ?np npx:signedBy ?user }
}
graph ?a {
?assignment gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
optional {
values ?mode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }
?assignment a ?mode .
}
}
filter(!bound(?mode) || !contains(str(?mode), "Deactivated"))
filter not exists {
graph npa:graph {
?np2 npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;
dct:created ?date2 ;
npx:embeds ?assignment2 ;
np:hasAssertion ?a2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
}
graph ?a2 {
?assignment2 a gen:DeactivatedPresetAssignment ;
gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
}
filter(?date2 > ?date)
}
optional {
graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }
graph ?pa {
optional { ?preset rdfs:label ?preset_label . }
}
}
}
order by desc(?date)
Returns the events related to the Three Point FAIRification Framework (3PFF) that are connected to a given Space: events that name the Space or one of its alternative IDs as participating community or as event sponsor. Intended as a view query for Space pages, with the optional multi-value 'space' parameter bound to the Space IRI and its owl:sameAs alternative IDs. Without parameter values, all 3PFF events are returned. One row per event with date and facilitators (facilitator names resolved from the trust repository, falling back to the URI's local name).
Get 3PFF events for Space
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix tpff: <https://w3id.org/fair/3pff/>
prefix schema: <http://schema.org/>
select
?Event
(max(?eventShortName) as ?Event_label)
(max(?eventLongName) as ?Name)
(max(?eventDate) as ?Date)
(group_concat(distinct str(?eventFacilitator); separator=" ") as ?Facilitators_multi_iri)
(group_concat(distinct replace(replace(coalesce(?eventFacilitatorName, replace(str(?eventFacilitator), "^.*[/#]", "")), "\\\\", "\\\\\\\\"), "[\\r\\n]+", "\\\\n"); separator="\n") as ?Facilitators_label_multi)
(sample(?np0) as ?np)
("^" as ?np_label)
where {
values ?__space_multi_iri {}
graph npa:graph {
?np0 npa:hasValidSignatureForPublicKey ?pubkey .
?np0 np:hasAssertion ?assertion .
?np0 npx:introduces ?Event .
filter not exists { ?npx npx:invalidates ?np0 ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
graph ?assertion {
?Event a tpff:3PFF-event .
{ ?Event tpff:has-participating-community ?__space_multi_iri . }
union
{ ?Event tpff:has-event-sponsor ?__space_multi_iri . }
?Event rdfs:label ?eventName .
optional { ?Event dct:date ?dateDct . }
optional { ?Event schema:startDate ?dateSchema . }
bind(coalesce(?dateDct, strBefore(str(?dateSchema), "T")) as ?eventDate)
bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName)
bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName)
optional {
?Event tpff:has-event-facilitator ?eventFacilitator .
optional {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> {
graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?trustState . }
graph ?trustState { ?eventFacilitator foaf:name ?eventFacilitatorName . }
}
}
}
}
}
group by ?Event
order by desc(?Date)
Lists the currently active view displays of a resource, for the About page: standalone view displays and the views contributed by assigned presets (marked in the via_preset column). Filtered to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves; deactivated entries (and entries with a newer deactivation for the same pair) are excluded. Shows each view (resolved to its latest version), its structural position, the contributing preset (if any), who added it, the date, and the source nanopub. Ordered by structural position.
List view displays
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select (coalesce(?viewLatest, ?viewRef) as ?view) ?view_label ?position
(?preset as ?via_preset) (?preset_label as ?via_preset_label)
(?user as ?added_by) (?date as ?date_added)
?deactivateView ?np ("^" as ?np_label) where {
values ?_resource_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
{
graph ?stateG {
?_resource_multi_iri npa:isMaintainedBy? ?space .
?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .
}
optional {
graph npa:spacesGraph {
?rd a npa:RoleDeclaration ; npa:forSpace ?space ;
npa:hasRoleType gen:MaintainerRole ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
bind(true as ?isMaintainer)
}
}
filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))
} union {
graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }
}
}
{
graph npa:graph {
?np npx:hasNanopubType gen:ViewDisplay ;
npa:hasValidSignatureForPublicKeyHash ?pubkey ;
dct:created ?date ;
npx:embeds ?display ;
np:hasAssertion ?a .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
optional { ?np npx:signedBy ?user }
}
graph ?a {
?display gen:isDisplayOfView ?viewRef ;
gen:isDisplayFor ?_resource_multi_iri .
optional {
values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay }
?display a ?displayMode .
}
}
}
union
{
select ?viewRef ?displayMode ?preset ?preset_label ?user ?date ?np ?pubkey ?_resource_multi_iri {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> {
graph npa:graph {
?np npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey ;
dct:created ?date ;
npx:embeds ?assignment ;
np:hasAssertion ?a .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
optional { ?np npx:signedBy ?user }
}
graph ?a {
?assignment gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
optional {
values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }
?assignment a ?displayMode .
}
}
filter not exists {
graph npa:graph {
?np2 npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;
dct:created ?date2 ;
npx:embeds ?assignment2 ;
np:hasAssertion ?a2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
}
graph ?a2 {
?assignment2 a gen:DeactivatedPresetAssignment ;
gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
}
filter(?date2 > ?date)
}
graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }
graph ?pa {
?preset a gen:Preset .
optional { ?preset rdfs:label ?preset_label . }
{ ?preset gen:hasTopLevelView ?viewRef } union { ?preset gen:hasView ?viewRef }
}
}
}
}
optional {
graph npa:graph { ?np np:hasAssertion ?npAssertion . }
graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . }
}
filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated"))
filter not exists {
graph npa:graph {
?np2 npx:hasNanopubType gen:ViewDisplay ;
npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;
dct:created ?date2 ;
npx:embeds ?display2 ;
np:hasAssertion ?a2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
}
graph ?a2 {
?display2 a gen:DeactivatedViewDisplay ;
gen:isDisplayOfView ?viewRef ;
gen:isDisplayFor ?_resource_multi_iri .
}
filter(?date2 > ?date)
}
optional {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> {
graph npa:graph { ?vnp npx:embeds ?viewRef . }
{ select ?vnp (max(?hDate) as ?headDate) where {
graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . }
graph npa:graph {
?vnp npa:hasValidSignatureForPublicKey ?k .
?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate .
filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . }
}
} group by ?vnp }
graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . }
graph npa:graph {
?vnp npa:hasValidSignatureForPublicKey ?vKey .
?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ;
npx:embeds ?viewLatest ; np:hasAssertion ?hva .
filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . }
}
graph ?hva { ?viewLatest dct:title ?view_label . }
optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } }
}
}
bind(coalesce(?dispPos, ?viewPos, "") as ?position)
bind(str(?viewRef) as ?deactivateView)
}
order by ?position desc(?date)
Lists the maintained resources of a given space (from the spaces repo) with a link to the source nanopublication. Label comes from each resource's definition assertion; resources whose definitions are all retracted or otherwise invalidated are filtered out. Ordered alphabetically by label.
List maintained resources of a space
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?resource ?resource_label ?np ("^" as ?np_label) where {
{
select ?resource
(sample(?label) as ?resource_label)
(sample(?viaNp) as ?np)
where {
values ?_space_multi_iri {}
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g { ?_space_multi_iri npa:hasMaintainedResource ?resource . }
graph ?ag { ?resource a gen:MaintainedResource ; rdfs:label ?label . }
graph npa:graph {
?defNp np:hasAssertion ?ag ; npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?inv npx:invalidates ?defNp ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
optional { graph npa:spacesGraph { ?d a npa:MaintainedResourceDeclaration ; npa:resourceIri ?resource ; npa:maintainerSpace ?_space_multi_iri ; npa:viaNanopub ?viaNp } }
}
group by ?resource
}
}
order by lcase(str(?resource_label))
Lists the sub-spaces of a given space (from the spaces repo) with their type and a link to the source nanopublication. Type and label come from each sub-space's root-definition assertion; sub-spaces whose definitions are all retracted or otherwise invalidated are filtered out. Ordered alphabetically by label.
List sub-spaces of a space
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?subspace ?subspace_label ?type ?np ("^" as ?np_label) where {
{
select ?subspace
(sample(?label) as ?subspace_label)
(coalesce(sample(?typeName), "") as ?type)
(sample(?rootNp) as ?np)
where {
values ?_space_multi_iri {}
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g { ?_space_multi_iri npa:hasSubSpace ?subspace . }
graph ?ag {
?subspace a gen:Space ; rdfs:label ?label .
optional { ?subspace a ?typeIri . filter(?typeIri != gen:Space) }
}
graph npa:graph {
?defNp np:hasAssertion ?ag ; npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?inv npx:invalidates ?defNp ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
bind(if(bound(?typeIri), strafter(str(?typeIri), "terms/"), "") as ?typeName)
optional { graph npa:spacesGraph { ?ref a npa:SpaceRef ; npa:spaceIri ?subspace ; npa:rootNanopub ?rootNp } }
}
group by ?subspace
}
}
order by lcase(str(?subspace_label))
This query returns the unanswered FAQ entries of an entity: questions whose most recent declaration is typed as gen:UnansweredQuestion (i.e. still carrying a placeholder instead of a real answer). Returns the question text as a plain label.
Get unanswered FAQ entries of an entity
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?question ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
?faq rdf:type schema:Question .
?faq rdf:type gen:UnansweredQuestion .
?faq rdfs:label ?question .
values ?_resource_multi_iri {}
?faq dct:isPartOf ?_resource_multi_iri .
optional { ?faq gen:hasPositionString ?position }
}
filter not exists {
graph npa:graph {
?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
?np2 dct:created ?date2 .
?np2 np:hasAssertion ?a2 .
filter (?date2 > ?date)
}
graph ?a2 {
?faq rdf:type schema:Question .
}
}
}
order by ?position ?question
Lists the members of a given space together with their highest role tier (admin, maintainer, or member, in that order) and links to the role-assignment nanopubs (labelled by the specific role name, preferring schema:name). Observer-tier roles are excluded. When the same role is assigned to the same person by multiple nanopubs, only the latest one is linked.
List space members
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
prefix schema: <http://schema.org/>
select ?user ?tier ?role_assignments_multi_iri ?role_assignments_label_multi where {
{
select ?user
(if(min(?rank)=1,"Admin",if(min(?rank)=2,"Maintainer","Member")) as ?tier)
(min(?rank) as ?rankMin)
(group_concat(?latestNp; separator=" ") as ?role_assignments_multi_iri)
(group_concat(?roleLabel; separator="\n") as ?role_assignments_label_multi)
where {
{
select ?user ?roleProp
(min(?rank0) as ?rank)
(sample(?roleLabel0) as ?roleLabel)
(strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp)
where {
values ?_space_multi_iri {}
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g {
?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user ; npa:viaNanopub ?grantNp .
}
bind(exists { graph ?g { ?ri npa:inverseProperty gen:hasAdmin } } as ?isAdmin)
optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?ropExt } }
optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?ropState } }
bind(coalesce(?ropExt,?ropState) as ?roleProp)
bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MaintainerRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMaintainer)
bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MemberRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMember)
bind(if(?isAdmin,1,if(?isMaintainer,2,if(?isMember,3,0))) as ?rank0)
optional { graph npa:graph { ?grantNp dct:created ?dateNp } }
optional {
graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp ; npa:role ?role . }
graph npa:graph { ?roleNp np:hasAssertion ?role_a . }
optional { graph ?role_a { ?role schema:name ?rlS } }
optional { graph ?role_a { ?role rdfs:label ?rlA } }
optional { graph ?role_a { ?role dct:title ?rlB } }
bind(coalesce(?rlS,?rlA,?rlB) as ?rl)
}
bind(if(?isAdmin,coalesce(?rl,"admin"),coalesce(?rl,"role")) as ?roleLabel0)
}
group by ?user ?roleProp
}
filter(?rank > 0)
}
group by ?user
}
}
order by ?rankMin ?user
This query returns the answered FAQ entries (questions and answers) of an entity, including source nanopub and date. Entries currently typed as gen:UnansweredQuestion (placeholder stubs) are excluded. When several nanopubs declare the same FAQ entry, only the most recent one is returned.
Get FAQ entries of an entity
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?title ?content ?date ?faq ?np where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
?faq rdf:type schema:Question .
?faq rdfs:label ?title .
?faq gen:hasContent ?content .
values ?_resource_multi_iri {}
?faq dct:isPartOf ?_resource_multi_iri .
filter not exists { ?faq rdf:type gen:UnansweredQuestion }
optional { ?faq gen:hasPositionString ?position }
}
filter not exists {
graph npa:graph {
?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
?np2 dct:created ?date2 .
?np2 np:hasAssertion ?a2 .
filter (?date2 > ?date)
}
graph ?a2 {
?faq rdf:type schema:Question .
}
}
}
order by ?position ?title
List space observers
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
prefix schema: <http://schema.org/>
select ?user ?role_assignments_multi_iri ?role_assignments_label_multi where {
{
select ?user
(max(?higher) as ?maxHigher)
(group_concat(?latestNp; separator=" ") as ?role_assignments_multi_iri)
(group_concat(?roleLabel; separator="\n") as ?role_assignments_label_multi)
where {
{
select ?user ?roleProp
(max(?higher0) as ?higher)
(sample(?roleLabel0) as ?roleLabel)
(strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp)
where {
values ?_space_multi_iri {}
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g {
?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user ; npa:viaNanopub ?grantNp .
}
bind(exists { graph ?g { ?ri npa:inverseProperty gen:hasAdmin } } as ?isAdmin)
optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?ropExt } }
optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?ropState } }
bind(coalesce(?ropExt,?ropState) as ?roleProp)
bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MaintainerRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMaintainer)
bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MemberRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMember)
bind(if(?isAdmin||?isMaintainer||?isMember,1,0) as ?higher0)
optional { graph npa:graph { ?grantNp dct:created ?dateNp } }
optional {
graph ?g { ?raRole a gen:RoleAssignment ; npa:forSpace ?_space_multi_iri ; gen:hasRole ?role . }
graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp ; npa:role ?role . }
graph npa:graph { ?roleNp np:hasAssertion ?role_a . }
optional { graph ?role_a { ?role schema:name ?rlS } }
optional { graph ?role_a { ?role rdfs:label ?rlA } }
optional { graph ?role_a { ?role dct:title ?rlB } }
bind(coalesce(?rlS,?rlA,?rlB) as ?rl)
}
bind(coalesce(?rl,"role") as ?roleLabel0)
}
group by ?user ?roleProp
}
}
group by ?user
having (max(?higher) = 0)
}
}
order by ?user
Returns basic key-value facts about a given space (type, start and end date for time-limited spaces, and the root-definition nanopub), taken from its latest non-invalidated space-declaration nanopub signed by an admin of the space. Each property and value is rendered as a link to its defining IRI where applicable. Both columns use the '_noheader' convention so the redundant header row is dropped.
Get space info
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct ?Property_noheader ?Property_label ?Value_noheader ?Value_label where {
values ?_space_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
graph ?stateG {
?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?admin .
?acct a npa:AccountState ; npa:agent ?admin ; npa:pubkey ?pubkey .
}
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np np:hasAssertion ?a .
}
graph ?a { ?_space_multi_iri a gen:Space . }
optional { graph ?a { ?_space_multi_iri a ?typeIri . filter(?typeIri != gen:Space) } }
optional { graph ?a { ?_space_multi_iri schema:startDate ?startVal } }
optional { graph ?a { ?_space_multi_iri schema:endDate ?endVal } }
values (?key ?Property_noheader ?Property_label) {
("Type" rdf:type "Type:")
("Start date" schema:startDate "Start date:")
("End date" schema:endDate "End date:")
("Root definition" gen:hasRootDefinition "Root definition:")
}
bind(if(?key="Type", ?typeIri, if(?key="Start date", str(?startVal), if(?key="End date", str(?endVal), ?np))) as ?Value_noheader)
filter(bound(?Value_noheader))
bind(if(?key="Type", replace(str(?typeIri),"^.*/",""), if(?key="Root definition", substr(strafter(str(?np), "/np/"), 1, 10), "")) as ?Value_label)
}
order by (if(?key="Type",1,if(?key="Start date",2,if(?key="End date",3,4))))
Returns the description (dct:description) of a given space, taken from its latest non-invalidated space-declaration nanopub that was signed by an admin of the space, as a single paragraph (content + source nanopub).
Get space description
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?content ?np where {
values ?_space_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
graph ?stateG {
?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?admin .
?acct a npa:AccountState ; npa:agent ?admin ; npa:pubkey ?pubkey .
}
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date ; np:hasAssertion ?a .
}
graph ?a {
?_space_multi_iri a gen:Space ; dct:description ?content .
}
}
order by desc(?date)
limit 1
Returns the introduction nanopublications of a given user (creation date, key location, declared public-key hashes), plus session-relative action targets from the viewer's local key (?__LOCALPUBKEY_multi) and site URL (?__SITEURL_multi): conditional retract/derive targets that are owner-gated (?_user_iri = ?__CURRENTUSER_multi_iri) and computed against the same notion of a 'local introduction' as the UI: an introduction SIGNED BY the local key, DECLARING the local key, whose local-key declaration has no location or matches the site URL (nanobench->nanodash). retract_target fires on a local introduction when there is more than one (duplicate cleanup); derive_target fires on a non-local introduction when there are zero local introductions. The retract/derive/local columns are action-mapping data (hidden from display by the result builders). The keys column annotates each declared key hash with its trust-approval status, federated from the trust repo: a checkmark when the key is loaded/approved for the user, a warning sign otherwise.
Get user introductions
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix dct: <http://purl.org/dc/terms/>
select (max(?date0) as ?date) (sample(str(?keyLocation)) as ?location)
(group_concat(distinct ?keyAnnotated; separator=", ") as ?keys) ?np ("^" as ?np_label)
(if(max(?isOwner) > 0 && max(?signedByLocal) > 0 && sum(?localDeclOk) > 0 && ?localCount > 1, str(?np), "") as ?retract_target)
(if(max(?isOwner) > 0 && (max(?signedByLocal) = 0 || sum(?localDeclOk) = 0) && ?localCount = 0 && max(?lpkBound) > 0, str(?np), "") as ?derive_target)
(sample(?lpk) as ?local_pubkey) (sample(?lpkShort) as ?local_pubkey_short)
(sample(?siteUrl) as ?site_url)
where {
values ?__LOCALPUBKEY_multi {}
values ?__SITEURL_multi {}
values ?__CURRENTUSER_multi_iri {}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?introPubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?introPubkey . }
?np dct:created ?date0 .
?np np:hasAssertion ?a .
}
graph ?a {
?keydeclaration npx:declaredBy ?_user_iri .
?keydeclaration npx:hasPublicKey ?pubkey .
optional { ?keydeclaration npx:hasKeyLocation ?keyLocation . }
bind(substr(sha256(?pubkey), 1, 10) as ?keyHash)
bind(lcase(sha256(str(?pubkey))) as ?keyHashFull)
}
bind(if(exists {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> {
graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . }
graph ?tg { ?acct npa:agent ?_user_iri ; npa:pubkey ?keyHashFull ; npa:trustStatus npa:loaded . }
}
}, concat("✅ ", ?keyHash), concat("⚠️ ", ?keyHash)) as ?keyAnnotated)
bind(coalesce(if(str(?pubkey) = str(?__LOCALPUBKEY_multi), 1, 0), 0) as ?isLocal)
bind(if(?isLocal = 1 && (!bound(?keyLocation) || coalesce(str(?keyLocation) = str(?__SITEURL_multi), false) || coalesce(replace(str(?keyLocation), "nanobench", "nanodash") = str(?__SITEURL_multi), false)), 1, 0) as ?localDeclOk)
bind(coalesce(if(str(?introPubkey) = str(?__LOCALPUBKEY_multi), 1, 0), 0) as ?signedByLocal)
bind(if(bound(?__LOCALPUBKEY_multi), 1, 0) as ?lpkBound)
bind(coalesce(if(?_user_iri = ?__CURRENTUSER_multi_iri, 1, 0), 0) as ?isOwner)
bind(coalesce(str(?__LOCALPUBKEY_multi), "") as ?lpk)
bind(if(strlen(?lpk) >= 45, concat(substr(?lpk, 1, 1), "..", substr(?lpk, 41, 5), ".."), "") as ?lpkShort)
bind(coalesce(str(?__SITEURL_multi), "") as ?siteUrl)
{
select (count(distinct ?lnp) as ?localCount) where {
values ?__LOCALPUBKEY_multi {}
values ?__SITEURL_multi {}
graph npa:graph {
?lnp npa:hasValidSignatureForPublicKey ?lsign .
filter not exists { ?lnpx npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lsign . }
?lnp np:hasAssertion ?la .
}
graph ?la {
?lkd npx:declaredBy ?_user_iri ; npx:hasPublicKey ?lpubkey .
optional { ?lkd npx:hasKeyLocation ?lloc . }
}
filter(coalesce(str(?lsign) = str(?__LOCALPUBKEY_multi), false))
filter(coalesce(str(?lpubkey) = str(?__LOCALPUBKEY_multi), false))
filter(!bound(?lloc) || coalesce(str(?lloc) = str(?__SITEURL_multi), false) || coalesce(replace(str(?lloc), "nanobench", "nanodash") = str(?__SITEURL_multi), false))
}
}
}
group by ?np ?localCount
order by desc(max(?date0))
Returns the member roles attached to the given space(s): trust-state-validated gen:RoleAssignments from the current space-state graph of the spaces repo (/repo/spaces), joined to their RoleDeclaration for the role's regular/inverse properties (space-separated), role tier (npa:hasRoleType), plus the role's label/name/title and role-assignment template. Pass one or more space IRIs.
Get space roles
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType
(group_concat(distinct ?reg; separator=" ") as ?regularProperties)
(group_concat(distinct ?inv; separator=" ") as ?inverseProperties)
?ra_np where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
values ?_space_multi_iri {}
graph ?g {
?ra a gen:RoleAssignment ;
npa:forSpace ?_space_multi_iri ;
gen:hasRole ?role ;
npa:viaNanopub ?ra_np .
}
graph npa:spacesGraph {
?roleDecl a npa:RoleDeclaration ;
npa:role ?role ;
npa:viaNanopub ?role_np .
optional { ?roleDecl gen:hasRegularProperty ?reg }
optional { ?roleDecl gen:hasInverseProperty ?inv }
optional { ?roleDecl npa:hasRoleType ?roleType }
}
graph npa:graph { ?role_np np:hasAssertion ?role_a . }
optional { graph ?role_a { ?role rdfs:label ?roleLabel } }
optional { graph ?role_a { ?role dct:title ?roleTitle } }
optional { graph ?role_a { ?role schema:name ?roleName } }
optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?roleAssignmentTemplate } }
} group by ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType ?ra_np
This query returns the details of all FIP declarations, including schema:version for R-FIP declarations.
Get FIP declaration details
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix dct: <http://purl.org/dc/terms/>
prefix dce: <http://purl.org/dc/elements/1.1/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix np: <http://www.nanopub.org/nschema#>
prefix dcat: <https://www.w3.org/ns/dcat#>
prefix schema: <https://schema.org/>
select ?decl_np ?community ?c ?question ?q ?sort ?nochoice ?decl ?rel ?resource_id_used ?startdate ?enddate ?date ?version where {
graph npa:graph {
?decl_np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?decl_np_x npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?decl_np npx:hasNanopubType fip:FIP-Declaration .
?decl_np dct:created ?date .
?decl_np np:hasAssertion ?assertion .
}
graph ?assertion {
?decl a fip:FIP-Declaration .
?decl fip:refers-to-question ?question .
{
{ ?decl fip:declares-current-use-of ?resource_id_used . bind(fip:declares-current-use-of as ?rel) }
union
{ ?decl fip:declares-planned-use-of ?resource_id_used . bind(fip:declares-planned-use-of as ?rel) }
union
{ ?decl fip:declares-planned-replacement-of ?resource_id_used . bind(fip:declares-planned-replacement-of as ?rel) }
union
{ ?decl fip:declares-replacement-from ?resource_id_used . bind(fip:declares-replacement-from as ?rel) }
union
{ ?decl fip:declares-replacement-to ?resource_id_used . bind(fip:declares-replacement-to as ?rel) }
}
# grlc gives an error for some reason if these two optional statements are at the end of the graph block:
optional { ?decl dcat:startDate ?startdate . }
optional { ?decl dcat:endDate ?enddate . }
?decl fip:declared-by ?community .
optional { ?decl schema:version ?version . }
}
bind (replace(str(?community), ".*[#/]", "") as ?c)
bind (replace(str(?supercommunity), ".*[#/]", "") as ?sc)
bind (replace(str(?question), "^.*-([^-MD]+(-[MD]+)?)$", "$1") as ?q)
bind (concat(replace(?q, "F|M", "0"), "x") as ?sort)
bind ("" as ?nochoice)
}
This query returns a list of all FIP communities that have supercommunities.
Get FIP supercommunities
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix fip: <https://w3id.org/fair/fip/terms/>
select distinct ?community (group_concat(distinct ?supercommunity; separator=" ") as ?supercommunities) (group_concat(distinct ?sc; separator=" ") as ?sc) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npx:hasNanopubType fip:FAIR-Implementation-Community .
?np (npx:introduces|npx:describes) ?community .
?np np:hasAssertion ?a .
}
graph ?a {
?community dct:isPartOf ?supercommunity .
}
optional {
graph npa:graph {
?disapproval np:hasAssertion ?da .
?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .
filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }
}
graph <https://w3id.org/np/RAkVk6aKWsmgcuKtPA7OSp2h-GbDfx8xrz_kJAAgY8Xa4#assertion> {
?dpubkeys npx:hasPublicKey ?dpubkey .
}
graph ?da {
?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .
}
} filter(!bound(?disapproval)) # for some reason this is much faster than "filter not exists"
bind(replace(str(?supercommunity), ".*[#/]", "") as ?sc)
} group by ?community
Returns the views to display for a given resource: both standalone view displays and the views contributed by assigned presets (issue #302), unioned and ordered by date so latest-wins override resolution holds across both. Filtered server-side to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves (for an agent's own page). Each referenced view is resolved to its latest version by following the npx:supersedes chain: among the version tree's current heads (nanopubs that are themselves neither superseded nor validly retracted via npx:invalidates), the most recent is chosen, so ?view is the latest non-retracted view definition (no separate latest-version lookup needed by the client). Choosing a current head rather than the max-timestamp node makes resolution robust to backdated supersedes and to retracted versions. Preset-derived rows have an unbound ?display and carry the resolved ?view plus the assignment's activation mode. The view-version resolution is wrapped in a run-once sub-SELECT so the cross-repo lookup is evaluated once for the whole view set rather than once per referenced view.
Get view displays
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct ?display ?view (coalesce(?viewKindOptional, ?view) as ?viewKind)
?label ?displayType ?displayMode ?np ?pubkey ?date where {
values ?_resource_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
{
graph ?stateG {
?_resource_multi_iri npa:isMaintainedBy? ?space .
?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .
}
optional {
graph npa:spacesGraph {
?rd a npa:RoleDeclaration ; npa:forSpace ?space ;
npa:hasRoleType gen:MaintainerRole ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
bind(true as ?isMaintainer)
}
}
filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))
} union {
graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }
}
}
{
# branch (a): standalone view displays — LOCAL pattern on the endpoint repo
graph npa:graph {
?np npx:hasNanopubType gen:ViewDisplay .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np npx:embeds ?display .
?np np:hasAssertion ?a .
optional { ?np rdfs:label ?label }
}
graph ?a {
?display gen:isDisplayOfView ?refView .
?display gen:isDisplayFor ?_resource_multi_iri .
optional { values ?displayType { gen:PartLevelViewDisplay gen:TopLevelViewDisplay } ?display a ?displayType . }
optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . }
}
}
union
{
# branch (b): preset-supplied views — wrapped in a sub-SELECT so the remote
# service does not collapse branch (a). ?display stays unbound.
select ?refView ?label ?displayType ?displayMode ?np ?pubkey ?date ?_resource_multi_iri {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> {
graph npa:graph {
?np npx:hasNanopubType gen:PresetAssignment .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np npx:embeds ?assignment .
?np np:hasAssertion ?a .
optional { ?np rdfs:label ?label }
}
graph ?a {
?assignment gen:isAssignmentFor ?_resource_multi_iri .
?assignment gen:isAssignmentOfPreset ?presetRef .
optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . }
}
graph npa:graph { ?presetNp npx:embeds ?presetRef ; np:hasAssertion ?pa . }
graph ?pa {
?presetRef a gen:Preset .
{ ?presetRef gen:hasTopLevelView ?refView . bind(gen:TopLevelViewDisplay as ?displayType) }
union { ?presetRef gen:hasView ?refView . bind(gen:PartLevelViewDisplay as ?displayType) }
}
}
}
}
# Resolve each referenced view to its latest version: the current head of its
# supersedes version tree (a nanopub itself neither superseded nor validly
# retracted via npx:invalidates), most recent among heads on a fork. Wrapped in
# a run-once sub-SELECT so this cross-repo service is evaluated once for the
# whole view set rather than once per referenced view -- the per-view federation
# round-trips were the dominant cost of earlier versions.
optional {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> {
select distinct ?refView ?latestView ?viewKindOptional where {
graph npa:graph { ?rnp npx:embeds ?refView ; np:hasAssertion ?ra . }
graph ?ra { ?refView a gen:ResourceView . }
optional {
?vnp npx:embeds ?refView .
?latestNp (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?ldate ; npx:embeds ?latestView ; np:hasAssertion ?va .
filter not exists { ?supNp npx:supersedes ?latestNp . }
filter not exists { ?invNp npx:invalidates ?latestNp ; npa:hasValidSignatureForPublicKeyHash ?invPk . }
filter not exists {
?other (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?odate .
filter not exists { ?supNp2 npx:supersedes ?other . }
filter not exists { ?invNp2 npx:invalidates ?other ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . }
filter(?odate > ?ldate)
}
graph ?va { ?latestView a gen:ResourceView . optional { ?latestView dct:isVersionOf ?viewKindOptional . } }
}
}
}
}
bind(coalesce(?latestView, ?refView) as ?view)
}
order by desc(?date)
Lists the view displays declared for a resource, for the About page: standalone view displays and the views contributed by assigned presets (marked with the preset). Filtered to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves. Each referenced view is resolved to its latest version (following the npx:supersedes chain): among the version tree's current heads (nanopubs that are themselves neither superseded nor validly retracted via npx:invalidates), the most recent is chosen, so the latest non-retracted view definition, title, and structural position are shown. Choosing a current head rather than the max-timestamp node makes resolution robust to backdated supersedes and to retracted versions. Results are ordered by structural position (the page ordering key) and then by view kind, replicating the order the views appear on the page. Shows each view, its title, its structural position, its active/deactivated status, the contributing preset (if any), the signer, the date, and the source nanopub. The view-version resolution is wrapped in a run-once sub-SELECT so the cross-repo lookup is evaluated once for the whole view set rather than once per referenced view.
List view displays
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?view ?view_label ?structuralPosition
(if(bound(?displayMode) && contains(str(?displayMode), "Deactivated"), "deactivated", "active") as ?status)
?preset ?preset_label ?user ?date ?np ("^" as ?np_label) where {
values ?_resource_multi_iri {}
service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
{
graph ?stateG {
?_resource_multi_iri npa:isMaintainedBy? ?space .
?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .
}
optional {
graph npa:spacesGraph {
?rd a npa:RoleDeclaration ; npa:forSpace ?space ;
npa:hasRoleType gen:MaintainerRole ;
(npa:inverseProperty|npa:regularProperty) ?roleProp .
bind(true as ?isMaintainer)
}
}
filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))
} union {
graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }
}
}
{
graph npa:graph {
?np npx:hasNanopubType gen:ViewDisplay ;
npa:hasValidSignatureForPublicKeyHash ?pubkey ;
dct:created ?date ;
npx:embeds ?display ;
np:hasAssertion ?a .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
optional { ?np npx:signedBy ?user }
}
graph ?a {
?display gen:isDisplayOfView ?refView ;
gen:isDisplayFor ?_resource_multi_iri .
optional {
values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay }
?display a ?displayMode .
}
}
}
union
{
select ?refView ?displayMode ?preset ?preset_label ?user ?date ?np ?pubkey ?_resource_multi_iri {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> {
graph npa:graph {
?np npx:hasNanopubType gen:PresetAssignment ;
npa:hasValidSignatureForPublicKeyHash ?pubkey ;
dct:created ?date ;
npx:embeds ?assignment ;
np:hasAssertion ?a .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
optional { ?np npx:signedBy ?user }
}
graph ?a {
?assignment gen:isAssignmentFor ?_resource_multi_iri ;
gen:isAssignmentOfPreset ?preset .
optional {
values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }
?assignment a ?displayMode .
}
}
graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }
graph ?pa {
?preset a gen:Preset .
optional { ?preset rdfs:label ?preset_label . }
{ ?preset gen:hasTopLevelView ?refView } union { ?preset gen:hasView ?refView }
}
}
}
}
# Resolve each referenced view to its latest version: the current head of its
# supersedes version tree (a nanopub itself neither superseded nor validly
# retracted via npx:invalidates), most recent among heads on a fork. Wrapped in
# a run-once sub-SELECT so this cross-repo service is evaluated once for the
# whole view set rather than once per referenced view -- the per-view federation
# round-trips were the dominant cost of earlier versions.
optional {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> {
select distinct ?refView ?latestView ?view_label ?structuralPosition ?viewKind where {
graph npa:graph { ?rnp npx:embeds ?refView ; np:hasAssertion ?ra . }
graph ?ra { ?refView a gen:ResourceView . }
optional {
?vnp npx:embeds ?refView .
?latestNp (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?ldate ; npx:embeds ?latestView ; np:hasAssertion ?va .
filter not exists { ?supNp npx:supersedes ?latestNp . }
filter not exists { ?invNp npx:invalidates ?latestNp ; npa:hasValidSignatureForPublicKeyHash ?invPk . }
filter not exists {
?other (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?odate .
filter not exists { ?supNp2 npx:supersedes ?other . }
filter not exists { ?invNp2 npx:invalidates ?other ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . }
filter(?odate > ?ldate)
}
graph ?va { ?latestView dct:title ?view_label . optional { ?latestView gen:hasStructuralPosition ?structuralPosition . } optional { ?latestView dct:isVersionOf ?viewKind . } }
}
}
}
}
bind(coalesce(?latestView, ?refView) as ?view)
}
order by ?structuralPosition coalesce(?viewKind, ?view) ?date
This query returns the use cases described for a given entity (a Space or Maintained Resource).
Get use cases for a resource
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?usecase ?usecase_label ?comment ?subject ?subject_label ?np ("^" as ?np_label) where {
graph npa:graph {
?np npx:hasNanopubType gen:isUseCaseFor .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?pi .
}
values ?_entity_multi_iri {}
graph ?a {
?usecase gen:isUseCaseFor ?_entity_multi_iri .
optional { ?usecase rdfs:label ?usecase_label . }
optional { ?usecase rdfs:comment ?comment . }
optional { ?usecase dct:subject ?subject . }
}
optional { graph ?pi { ?subject nt:hasLabelFromApi ?subject_label . } }
}
This query returns basic profile properties of a given user: the most recent default license and profile picture, one per row, each with its source nanopublication.
Get user profile info
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix dct: <http://purl.org/dc/terms/>
prefix schema: <https://schema.org/>
prefix kpxl_terms: <https://w3id.org/kpxl/gen/terms/>
select ?property ?value ?np ("^" as ?np_label) where {
{
select ("Default license" as ?property) ?value ?np where {
graph npa:graph {
?np np:hasAssertion ?a .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
}
graph ?a { ?_user_iri kpxl_terms:hasDefaultLicense ?value . }
}
order by desc(?date)
limit 1
}
union
{
select ("Profile picture" as ?property) ?value ?np where {
graph npa:graph {
?np np:hasAssertion ?a .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
}
graph ?a { ?_user_iri schema:image ?value . }
}
order by desc(?date)
limit 1
}
}
order by ?property
Given a resource, this query returns the glossary of terms it references: SKOS concepts linked from the resource via dct:references. Each row reports the term (identified by its Wikidata URI) with its preferred label, the human-readable definition, and a link to the nanopublication that defines the concept.
Get glossary for a resource
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
select distinct (?concept as ?term) ?term_label ?definition ?np ("^" as ?np_label) where {
graph npa:graph { ?np np:hasAssertion ?a . }
graph ?a {
?_resource_iri dct:references ?concept .
?concept a skos:Concept ;
rdfs:label ?term_label ;
skos:definition ?definition .
}
graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pk . }
filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } }
}
order by ?term_label
Returns a list of all events related to the Three Point FAIRification Framework (3PFF), with multi-value fields pre-rendered as HTML anchor strings. Organizer and facilitator links use the agent's display name (resolved from the trust repository) as anchor text, falling back to the URI's local name. Variant of get-3pff-events intended for consumption by clients (e.g. nanopub-table with data-bind-html) that cannot split space-separated URI lists on their own.
Get 3PFF Events (HTML)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix tpff: <https://w3id.org/fair/3pff/>
prefix schema: <http://schema.org/>
select
(?event as ?Event_ID)
(?eventShortName as ?Event_ID__label)
(?eventLongName as ?Event_Name)
(?eventDate as ?Date)
(concat("<span>", group_concat(distinct concat(
"<a href=\"", str(?eventOrganizer), "\">",
coalesce(?eventOrganizerName, replace(str(?eventOrganizer), "^.*[/#]", "")),
"</a>"
); separator=", "), "</span>") as ?Organizers)
(concat("<span>", group_concat(distinct concat(
"<a href=\"", str(?eventFacilitator), "\">",
coalesce(?eventFacilitatorName, replace(str(?eventFacilitator), "^.*[/#]", "")),
"</a>"
); separator=", "), "</span>") as ?Facilitators)
(concat("<span>", group_concat(distinct concat(
"<a href=\"", str(?eventMoreInfoLink), "\">",
replace(str(?eventMoreInfoLink), "^.*[/#]", ""),
"</a>"
); separator=", "), "</span>") as ?More_Info)
(?np as ?Source)
where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np dct:created ?npDate .
?np dct:creator ?npCreator .
?np np:hasAssertion ?assertion .
?np npx:introduces ?event .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
graph ?assertion {
?event a tpff:3PFF-event .
?event rdfs:label ?eventName .
# Date Handling: Check for both predicates
optional { ?event dct:date ?dateDct . }
optional { ?event schema:startDate ?dateSchema . }
bind(coalesce(?dateDct, strBefore(str(?dateSchema), "T")) as ?eventDate)
bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName)
bind(replace(str(?eventName), '^([A-Z0-9]{2,3}).*$', '$1') as ?eventSeries)
bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName)
optional {
?event tpff:has-event-organizer ?eventOrganizer .
optional {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> {
graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?organizerTrustState . }
graph ?organizerTrustState { ?eventOrganizer foaf:name ?eventOrganizerName . }
}
}
}
optional {
?event tpff:has-event-facilitator ?eventFacilitator .
optional {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> {
graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?facilitatorTrustState . }
graph ?facilitatorTrustState { ?eventFacilitator foaf:name ?eventFacilitatorName . }
}
}
}
optional {
?event rdfs:seeAlso ?eventMoreInfoLink .
}
}
}
group by ?event ?eventShortName ?eventLongName ?eventDate ?np
order by desc(?eventDate)
Given a resource, this query returns the papers it cites via any CiTO relation. For each citation it reports the citation type used (the CiTO property, with a human-readable label), the cited paper's title (linked to its DOI) and publication date (from the paper's bibliographic metadata nanopublication, if any), and a link to the citation nanopublication that asserts the citation. Citations whose cited paper has no bibliographic metadata nanopublication yet are still returned (with empty title and publication date).
Get cited papers for a resource
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
select distinct (?citoProp as ?citation_type) ?citation_type_label (?paper as ?title) ?title_label ?publication_date (?citeNp as ?np) ("^" as ?np_label) where {
graph npa:graph { ?citeNp np:hasAssertion ?ca . }
graph ?ca { ?_resource_iri ?citoProp ?paper . }
filter(strstarts(str(?citoProp), "http://purl.org/spar/cito/"))
bind(lcase(replace(replace(str(?citoProp), "http://purl.org/spar/cito/", ""), "([a-z])([A-Z])", "$1 $2")) as ?citation_type_label)
filter not exists { graph npa:graph { ?cinv npx:invalidates ?citeNp . } }
optional {
graph npa:graph { ?descNp npx:introduces ?paper . ?descNp np:hasAssertion ?pa . }
graph ?pa { ?paper dct:title ?title_label . }
optional { graph ?pa { ?paper dct:date ?publication_date . } }
graph npa:graph { ?descNp npa:hasValidSignatureForPublicKey ?pk . }
filter not exists { graph npa:graph { ?inv npx:invalidates ?descNp ; npa:hasValidSignatureForPublicKey ?pk . } }
}
}
order by ?citation_type_label ?publication_date ?title_label
Given a resource, this query returns the claims (AIDA sentences) it covers via gen:coversClaim. Each statement links to the AIDA sentence and is labelled with the sentence text.
Get claims for a resource
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct (?claim as ?statement) ?statement_label ?np ("^" as ?np_label) where {
graph npa:graph { ?np np:hasAssertion ?a . }
graph ?a {
?_resource_iri gen:coversClaim ?claim .
?claim a <http://purl.org/petapico/o/hycl#AIDA-Sentence> .
}
optional { graph npa:graph { ?np rdfs:label ?statement_label . } }
graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pk . }
filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } }
}
order by ?statement_label
All observation FDOs about the Alpha Spike RBD variant — real-world occurrence, computational predictions, experimental DMS, and WHO classification — forming the FAIR Digital Twin knowlet for Alpha. Worked example of a single FDT.
MAC FDT — Alpha variant digital twin (knowlet)
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX fdof: <https://w3id.org/fdof/ontology#>
PREFIX mac: <https://w3id.org/spaces/mac/r/ontology/>
SELECT ?obs ?type ?label WHERE {
GRAPH npa:graph {
?n1 npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists {
?np2 npx:invalidates ?n1 ;
npa:hasValidSignatureForPublicKey ?pubkey .
}
?n1 np:hasAssertion ?a .
}
graph ?a {
?obs mac:isObservationOf <https://w3id.org/np/RAngbyT2iZe4xYUcPnTnDFKDaiL5-tSmoUYzF9RK3LHdE/Alpha-RBD-Variant> .
?obs a ?type .
FILTER(?type != fdof:FAIRDigitalObject)
OPTIONAL { ?obs rdfs:label ?label . }
}
} ORDER BY ?type
Returns the nanopublications that introduce, describe, or embed the given term, with view-friendly columns (np / np_label and a source column rendered as a '^' explore link). Used by the /explore page as a resource view (the 'Described in nanopublication' list).
Get term descriptions
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
select ?np ?np_label ?source ("^" as ?source_label) where {
values ?__pubkey_multi {}
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi . }
?np dct:created ?date .
?np npx:introduces|npx:describes|npx:embeds ?_term_iri .
optional { ?np rdfs:label ?np_label . }
}
bind(?np as ?source)
} order by desc(?date)
Returns the instances assigned to the given class, with view-friendly columns (instance / instance_label). Used by the /explore page as a resource view (the 'Has instances' list).
Get instances for class (view)
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select distinct ?instance ?instance_label where {
graph ?g {
?instance a ?_class_iri .
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npa:hasGraph ?g .
?np np:hasPublicationInfo ?i .
}
optional { graph ?g { ?instance rdfs:label ?instanceLabel1 . } }
optional { graph ?g { ?instance dct:title ?instanceLabel2 . } }
optional { graph ?i { ?instance rdfs:label ?instanceLabel3 . } }
optional { graph ?i { ?instance nt:hasLabelFromApi ?instanceLabel4 . } }
bind(coalesce(?instanceLabel1, ?instanceLabel2, ?instanceLabel3, ?instanceLabel4) as ?instance_label)
} limit 1000
Returns the instances assigned to the given class, with view-friendly columns (instance / instance_label). Used by the /explore page as a resource view (the 'Has instances' list).
Get instances for class (view)
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select distinct ?instance ?instance_label ?np ("^" as ?np_label) where {
graph ?g {
?instance a ?_class_iri .
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npa:hasGraph ?g .
?np np:hasPublicationInfo ?i .
}
optional { graph ?g { ?instance rdfs:label ?instanceLabel1 . } }
optional { graph ?g { ?instance dct:title ?instanceLabel2 . } }
optional { graph ?i { ?instance rdfs:label ?instanceLabel3 . } }
optional { graph ?i { ?instance nt:hasLabelFromApi ?instanceLabel4 . } }
bind(coalesce(?instanceLabel1, ?instanceLabel2, ?instanceLabel3, ?instanceLabel4) as ?instance_label)
} limit 1000
Returns the things denoted as parts of the given thing, with view-friendly columns (part / part_label). Used by the /explore page as a resource view (the 'Has parts' list).
Get parts of a thing (view)
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?part (sample(?partLabel) as ?part_label) where {
{ graph ?g {
?_thing_iri dct:hasPart ?part .
}
filter not exists {
graph npa:graph {
?part npx:hasNanopubType npx:NanopubIndex .
}
}
} union
{ graph ?g {
?part dct:partOf ?_thing_iri .
}
} union
{ graph ?gx {
?_thing_iri dct:hasPart ?index .
}
graph npa:graph {
?index npx:hasNanopubType npx:NanopubIndex .
?index np:hasAssertion ?a .
}
graph ?a {
?index npx:includesElement ?np .
}
graph npa:graph {
?np npx:introduces ?part .
}
}
graph npa:graph {
?np npa:hasGraph ?g .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np np:hasPublicationInfo ?i .
}
optional { graph ?g { ?part rdfs:label ?partLabel1 . } }
optional { graph ?g { ?part dct:title ?partLabel2 . } }
optional { graph ?i { ?part rdfs:label ?partLabel3 . } }
optional { graph ?i { ?part nt:hasLabelFromApi ?partLabel4 . } }
optional { graph ?x { ?part rdfs:label ?partLabel5 . } }
bind(coalesce(?partLabel1, ?partLabel2, ?partLabel3, ?partLabel4, ?partLabel5) as ?partLabel)
}
group by ?part
limit 1000
Returns the things denoted as parts of the given thing, with view-friendly columns (part / part_label). Used by the /explore page as a resource view (the 'Has parts' list).
Get parts of a thing (view)
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?part (sample(?partLabel) as ?part_label) ?np ("^" as ?np_label) where {
{ graph ?g {
?_thing_iri dct:hasPart ?part .
}
filter not exists {
graph npa:graph {
?part npx:hasNanopubType npx:NanopubIndex .
}
}
} union
{ graph ?g {
?part dct:partOf ?_thing_iri .
}
} union
{ graph ?gx {
?_thing_iri dct:hasPart ?index .
}
graph npa:graph {
?index npx:hasNanopubType npx:NanopubIndex .
?index np:hasAssertion ?a .
}
graph ?a {
?index npx:includesElement ?np .
}
graph npa:graph {
?np npx:introduces ?part .
}
}
graph npa:graph {
?np npa:hasGraph ?g .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np np:hasPublicationInfo ?i .
}
optional { graph ?g { ?part rdfs:label ?partLabel1 . } }
optional { graph ?g { ?part dct:title ?partLabel2 . } }
optional { graph ?i { ?part rdfs:label ?partLabel3 . } }
optional { graph ?i { ?part nt:hasLabelFromApi ?partLabel4 . } }
optional { graph ?x { ?part rdfs:label ?partLabel5 . } }
bind(coalesce(?partLabel1, ?partLabel2, ?partLabel3, ?partLabel4, ?partLabel5) as ?partLabel)
}
group by ?part ?np
limit 1000
Returns the classes assigned to the given thing, with view-friendly columns (class / class_label). Used by the /explore page as a resource view (the 'Assigned to' list).
Get the classes assigned to a thing (view)
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select distinct ?class ?class_label ?np ("^" as ?np_label) where {
graph ?g {
?_thing_iri a ?class .
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npa:hasGraph ?g .
?np np:hasPublicationInfo ?i .
}
optional { graph ?g { ?class rdfs:label ?classLabel1 . } }
optional { graph ?g { ?class dct:title ?classLabel2 . } }
optional { graph ?i { ?class rdfs:label ?classLabel3 . } }
optional { graph ?i { ?class nt:hasLabelFromApi ?classLabel4 . } }
bind(coalesce(?classLabel1, ?classLabel2, ?classLabel3, ?classLabel4) as ?class_label)
} limit 1000
Returns the classes assigned to the given thing, with view-friendly columns (class / class_label). Used by the /explore page as a resource view (the 'Assigned to' list).
Get the classes assigned to a thing (view)
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select distinct ?class ?class_label where {
graph ?g {
?_thing_iri a ?class .
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npa:hasGraph ?g .
?np np:hasPublicationInfo ?i .
}
optional { graph ?g { ?class rdfs:label ?classLabel1 . } }
optional { graph ?g { ?class dct:title ?classLabel2 . } }
optional { graph ?i { ?class rdfs:label ?classLabel3 . } }
optional { graph ?i { ?class nt:hasLabelFromApi ?classLabel4 . } }
bind(coalesce(?classLabel1, ?classLabel2, ?classLabel3, ?classLabel4) as ?class_label)
} limit 1000
Returns the assertion templates that use the given URI in their statements, with view-friendly columns (template_iri / template_iri_label). Used by the /explore page as a resource view (the 'Related Templates' list).
Get the templates using given URI (view)
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select distinct ?template_iri ?template_iri_label ?np ("^" as ?np_label) where {
graph ?assertion {
?statement ?relation ?_thing_iri .
values ?relation { rdf:subject rdf:predicate rdf:object nt:possibleValue }
}
graph npa:graph {
?template_iri npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?template_iri ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?template_iri npx:hasNanopubType nt:UnlistedTemplate . }
?template_iri np:hasAssertion ?assertion .
optional { ?template_iri rdfs:label ?template_iri_label }
bind(?template_iri as ?np)
}
} limit 1000
Returns the assertion templates that use the given URI in their statements, with view-friendly columns (template_iri / template_iri_label). Used by the /explore page as a resource view (the 'Related Templates' list).
Get the templates using given URI (view)
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select distinct ?template_iri ?template_iri_label where {
graph ?assertion {
?statement ?relation ?_thing_iri .
values ?relation { rdf:subject rdf:predicate rdf:object nt:possibleValue }
}
graph npa:graph {
?template_iri npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?template_iri ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?template_iri npx:hasNanopubType nt:UnlistedTemplate . }
?template_iri np:hasAssertion ?assertion .
optional { ?template_iri rdfs:label ?template_iri_label }
}
} limit 1000
Returns the nanopublications that introduce, describe, or embed the given term, with view-friendly columns (np / np_label). Used by the /explore page as a resource view (the 'Described in' list).
Get term descriptions
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
select ?np ?np_label where {
values ?__pubkey_multi {}
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi . }
?np dct:created ?date .
?np npx:introduces|npx:describes|npx:embeds ?_term_iri .
optional { ?np rdfs:label ?np_label . }
}
} order by desc(?date)
Returns nanopublications referencing the given URI in subject, predicate, or object position, with view-friendly columns (part / subject / predicate / object / published_by / date / np). Used by the /references page as a resource view.
Get URI references
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
select ?part ?subject ?predicate ?object ?published_by ?date ?np ("^" as ?np_label) where {
graph ?g {
{ { bind(?_ref_iri as ?subject) } union { bind(?_ref_iri as ?predicate) } union { bind(?_ref_iri as ?object) } }
?subject ?predicate ?object .
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?__pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . }
?np dct:created ?date .
?np ?__graphpred_iri ?g .
values ?__graphpred_iri { np:hasAssertion np:hasProvenance np:hasPublicationInfo }
}
bind(strafter(str(?__graphpred_iri), "#has") as ?part)
optional {
graph npa:graph { ?np np:hasPublicationInfo ?__pig_iri . }
graph ?__pig_iri { ?np dct:creator ?published_by . }
}
} limit 100
Returns one row per known space with its label, type IRI and short type name, ordered alphabetically by space label. Intended for the /spaces table view.
Get all spaces
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?space_iri (sample(?lbl) as ?space_iri_label) (sample(?t) as ?type) (sample(?tlbl) as ?type_label) where {
graph npa:spacesGraph {
?spaceRef a npa:SpaceRef ; npa:spaceIri ?space_iri .
?def a npa:SpaceDefinition ;
npa:forSpaceRef ?spaceRef ;
npa:viaNanopub ?np .
}
graph npa:graph {
?np rdfs:label ?lbl .
?np npx:hasNanopubType ?t .
filter(strstarts(str(?t), "https://w3id.org/kpxl/gen/terms/"))
filter(?t != gen:Space)
}
filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } }
bind(strafter(str(?t), "https://w3id.org/kpxl/gen/terms/") as ?tlbl)
} group by ?space_iri order by lcase(sample(?lbl))
Returns the latest non-invalidated SpaceDefinition per space from the server-materialised spaces repo, joined to the declaring nanopublication for its label and type. View-friendly columns (space_iri / type_label / np).
Get spaces (v2)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?space_iri ?space_iri_label ?type ?type_label ?date ?np ("^" as ?np_label) where {
graph npa:spacesGraph {
?spaceRef a npa:SpaceRef ; npa:spaceIri ?space_iri .
?def a npa:SpaceDefinition ;
npa:forSpaceRef ?spaceRef ;
npa:viaNanopub ?np ;
dct:created ?date .
}
graph npa:graph {
?np rdfs:label ?space_iri_label .
?np npx:hasNanopubType ?type .
filter(strstarts(str(?type), "https://w3id.org/kpxl/gen/terms/"))
filter(?type != gen:Space)
}
filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } }
bind(strafter(str(?type), "https://w3id.org/kpxl/gen/terms/") as ?type_label)
} order by desc(?date)
Returns all nanopublications that declare a grlc query, with the query IRI, its label, its creator, the creation date, and the nanopublication IRI. Designed for rendering as a list/table view.
Get all grlc query nanopubs (v2)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix grlc: <https://w3id.org/kpxl/grlc/>
select ?query_iri ?query_iri_label ?creator ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . }
?np dct:created ?date .
?np npx:introduces|npx:embeds ?query .
?np np:hasAssertion ?a .
?np npx:hasNanopubType grlc:grlc-query .
optional { ?np rdfs:label ?query_iri_label }
optional { ?np npx:signedBy ?creator . }
}
graph ?a {
?query grlc:endpoint ?endpoint .
filter(strstarts(str(?endpoint), "https://w3id.org/np/l/nanopub-query"))
}
bind(?query as ?query_iri)
} order by desc(?date)
Counts of MAC FDT FDOs grouped by their specific type (variants, observations, methods). Bounded summary view of the full catalogue.
MAC FDT — catalogue summary by type
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX fdof: <https://w3id.org/fdof/ontology#>
PREFIX mac: <https://w3id.org/spaces/mac/r/ontology/>
SELECT ?type (COUNT(?thing) AS ?count) WHERE {
GRAPH npa:graph {
?n1 npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists {
?np2 npx:invalidates ?n1 ;
npa:hasValidSignatureForPublicKey ?pubkey .
}
?n1 np:hasAssertion ?a .
}
graph ?a {
?thing a fdof:FAIRDigitalObject .
?thing a ?type .
FILTER(?type != fdof:FAIRDigitalObject)
FILTER(STRSTARTS(STR(?type), "https://w3id.org/spaces/mac/r/ontology/"))
}
} GROUP BY ?type ORDER BY DESC(?count)
Counts of observation FDOs grouped by the method (computational, experimental, or surveillance) that produced them — demonstrating multi-source decentralized attribution.
MAC FDT — observations per method
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX fdof: <https://w3id.org/fdof/ontology#>
PREFIX mac: <https://w3id.org/spaces/mac/r/ontology/>
SELECT ?method (COUNT(?obs) AS ?count) WHERE {
GRAPH npa:graph {
?n1 npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists {
?np2 npx:invalidates ?n1 ;
npa:hasValidSignatureForPublicKey ?pubkey .
}
?n1 np:hasAssertion ?a .
}
graph ?a {
?obs ?methodPred ?method .
VALUES ?methodPred { mac:hasPredictionMethod mac:hasExperimentalMethod mac:hasSurveillanceMethod }
}
} GROUP BY ?method ORDER BY DESC(?count)
Counts of Spike RBD variants grouped by WHO risk designation (VOC / VOI / VUM), via their WHO classification observation FDOs.
MAC FDT — variants by WHO classification
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX fdof: <https://w3id.org/fdof/ontology#>
PREFIX mac: <https://w3id.org/spaces/mac/r/ontology/>
SELECT ?whoClass (COUNT(?variant) AS ?count) WHERE {
GRAPH npa:graph {
?n1 npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists {
?np2 npx:invalidates ?n1 ;
npa:hasValidSignatureForPublicKey ?pubkey .
}
?n1 np:hasAssertion ?a .
}
graph ?a {
?obs a mac:WHOVariantClassification .
?obs mac:hasWHOClassification ?whoClass .
?obs mac:isObservationOf ?variant .
}
} GROUP BY ?whoClass ORDER BY DESC(?count)
Returns all users that have published a self-introduction but have no approved (trust-state-loaded) account, with their display name.
❓ Non-Approved Users
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select ?user_iri (sample(?name) as ?user_iri_label) where {
graph npa:graph {
?intronp npa:hasValidSignatureForPublicKey ?pk ; np:hasAssertion ?a .
filter not exists { ?x npx:invalidates ?intronp ; npa:hasValidSignatureForPublicKey ?pk . }
}
graph ?a {
?kd npx:declaredBy ?user_iri .
optional { ?user_iri foaf:name ?name }
}
minus {
service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> {
graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?g . }
graph ?g { ?acct npa:agent ?user_iri ; npa:trustStatus npa:loaded . }
}
}
} group by ?user_iri order by lcase(str(sample(?name)))
Returns all approved (trust-state-loaded) users that are not software agents, with their display name.
👤 Human Users
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select ?user_iri (sample(?name) as ?user_iri_label) where {
graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?g . }
graph ?g { ?acct a npa:AccountState ; npa:agent ?user_iri ; npa:trustStatus npa:loaded . }
service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/77757cabf6184c51c20b8b0fe5dc5e1365b7f628448335184ad54319a0affdfc> {
graph ?a { ?kd npx:declaredBy ?user_iri . }
filter not exists { graph ?a2 { ?user_iri a npx:SoftwareAgent } }
optional { graph ?a { ?user_iri foaf:name ?name } }
}
} group by ?user_iri order by lcase(str(sample(?name)))
Returns all approved (trust-state-loaded) users that are software agents, with their display name.
🤖 Software Agents
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select ?user_iri (sample(?name) as ?user_iri_label) where {
graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?g . }
graph ?g { ?acct a npa:AccountState ; npa:agent ?user_iri ; npa:trustStatus npa:loaded . }
service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/77757cabf6184c51c20b8b0fe5dc5e1365b7f628448335184ad54319a0affdfc> {
graph ?a { ?kd npx:declaredBy ?user_iri . }
filter exists { graph ?a2 { ?user_iri a npx:SoftwareAgent } }
optional { graph ?a { ?user_iri foaf:name ?name } }
}
} group by ?user_iri order by lcase(str(sample(?name)))
Returns the trust-state-validated (agent, public-key-hash) pairs for the given agent(s), from npa:AccountState in the current space-state graph of the spaces repo (/repo/spaces). Pass one or more agent IRIs (e.g. ORCIDs).
Get agent pubkey hashes
prefix npa: <http://purl.org/nanopub/admin/>
select distinct (?_agent_multi_iri as ?agent) ?pkh where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
values ?_agent_multi_iri {}
graph ?g {
?acct a npa:AccountState ;
npa:agent ?_agent_multi_iri ;
npa:pubkey ?pkh .
}
}
Returns the trust-state-validated (agent, public-key-hash) pairs of the given space(s)' admins, by joining the admin RoleInstantiations to npa:AccountState in the current space-state graph of the spaces repo (/repo/spaces). Pass one or more space IRIs.
Get space admin pubkey hashes
prefix npa: <http://purl.org/nanopub/admin/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct ?agent ?pkh where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
values ?_space_multi_iri {}
graph ?g {
?ri a gen:RoleInstantiation ;
npa:inverseProperty gen:hasAdmin ;
npa:forSpace ?_space_multi_iri ;
npa:forAgent ?agent .
?acct a npa:AccountState ;
npa:agent ?agent ;
npa:pubkey ?pkh .
}
}
Returns the admins of the given space(s): the trust-state-validated admin RoleInstantiations (npa:inverseProperty gen:hasAdmin) from the current space-state graph of the spaces repo (/repo/spaces), with each admin agent and the nanopublication that instantiated the role. Pass one or more space IRIs (e.g. a space and its alternative IDs).
Get space admins
prefix npa: <http://purl.org/nanopub/admin/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct ?agent ?np ("^" as ?np_label) where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
values ?_space_multi_iri {}
graph ?g {
?ri a gen:RoleInstantiation ;
npa:inverseProperty gen:hasAdmin ;
npa:forSpace ?_space_multi_iri ;
npa:forAgent ?agent ;
npa:viaNanopub ?np .
}
}
Returns the non-admin member RoleInstantiations of the given space(s) from the extraction graph (npa:spacesGraph) of the spaces repo (/repo/spaces): each member agent, the nanopublication that instantiated the membership, and the role's regular/inverse predicate. Admin RIs are excluded and invalidated nanopubs are filtered out. The caller is expected to gate members by role-predicate match. Pass one or more space IRIs.
Get space members
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?member ?regProp ?invProp ?np ("^" as ?np_label) where {
values ?_space_multi_iri {}
graph npa:spacesGraph {
?ri a gen:RoleInstantiation ;
npa:forSpace ?_space_multi_iri ;
npa:forAgent ?member ;
npa:viaNanopub ?np .
optional { ?ri npa:regularProperty ?regProp }
optional { ?ri npa:inverseProperty ?invProp }
filter not exists { ?ri npa:inverseProperty gen:hasAdmin }
}
filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } }
}
Returns server-validated maintained resources (npa:isMaintainedBy) from the current space-state graph of the spaces repo (/repo/spaces), with each resource's maintainer space, declaring nanopublication, label, optional namespace, and date. Only the current-state declarations are returned.
Get maintained resources from spaces repo
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?resource ?space ?label ?namespace ?date ?np ("^" as ?np_label) where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g { ?resource npa:isMaintainedBy ?space . }
graph npa:spacesGraph {
?d a npa:MaintainedResourceDeclaration ;
npa:resourceIri ?resource ;
npa:maintainerSpace ?space ;
npa:viaNanopub ?np ;
dct:created ?date .
}
graph npa:graph {
?np np:hasAssertion ?a .
optional { ?np rdfs:label ?label }
}
optional { graph ?a { ?resource gen:hasNamespace ?namespace } }
} order by desc(?date)
Returns all child/parent space pairs (npa:isSubSpaceOf) from the current space-state graph of the server-materialised spaces repo (/repo/spaces).
Get sub-space links
prefix npa: <http://purl.org/nanopub/admin/>
select ?child ?parent where {
graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }
graph ?g { ?child npa:isSubSpaceOf ?parent . }
}
Returns all provenance-event claims (Colonial Collections nanopubs typed #ProvenanceEventVersion1) describing a CIDOC-CRM E10_Transfer_of_Custody. Columns: event type (Getty AAT) and its label, affected object (with short label), narrative text and its language, attributed community group, individual creator, and date. Sorted from most recent first.
Get Colonial Collections provenance events
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
prefix crm: <http://www.cidoc-crm.org/cidoc-crm/>
select ?event_type ?event_type_label ?source ?source_label ?narrative ?lang ?group ?group_label ?creator ?creator_label ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey ;
dct:created ?datetime ;
np:hasAssertion ?ag ;
np:hasProvenance ?pg ;
np:hasPublicationInfo ?pig .
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
bind(substr(str(?datetime), 1, 10) as ?date)
graph ?pig {
?np a <https://n2t.net/ark:/27023/9819f32405815dc7f2e0ecd9d8a9e604#ProvenanceEventVersion1> .
}
graph ?ag {
?ev a crm:E10_Transfer_of_Custody .
optional {
?ev crm:P2_has_type ?event_type .
optional { ?event_type rdfs:label ?event_type_label }
}
optional {
?ev crm:P30_transferred_custody_of ?source .
bind(substr(replace(str(?source), "^.*/", ""), 1, 8) as ?source_label)
}
optional {
?ev crm:P67i_is_referred_to_by ?ling .
?ling crm:P190_has_symbolic_content ?narrative_lit .
bind(str(?narrative_lit) as ?narrative)
bind(lang(?narrative_lit) as ?lang)
}
}
optional {
graph ?pg {
?ag prov:wasAttributedTo ?creator .
optional { ?creator rdfs:label ?creator_label }
optional {
?creator prov:actedOnBehalfOf ?group .
optional { ?group rdfs:label ?group_label }
}
}
}
}
order by desc(?datetime)
Returns all Web Annotations (oa:Annotation) contained in Colonial Collections nanopubs, together with their specific content subtype, the scope (which field of the target object the annotation refines), the source object (with a short label derived from its identifier), the body text and its language, the community group on whose behalf the annotation was made, the individual creator, and the creation date. Sorted from most recent first.
Get Colonial Collections annotations
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix oa: <http://www.w3.org/ns/oa#>
prefix prov: <http://www.w3.org/ns/prov#>
select ?subtype ?subtype_label ?scope ?scope_label ?source ?source_label ?body ?lang ?group ?group_label ?creator ?creator_label ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey ;
dct:created ?datetime ;
np:hasAssertion ?ag ;
np:hasProvenance ?pg ;
np:hasPublicationInfo ?pig .
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
bind(substr(str(?datetime), 1, 10) as ?date)
graph ?pig {
?np a ?subtype .
filter(strstarts(str(?subtype), "https://n2t.net/ark:/27023/9819f32405815dc7f2e0ecd9d8a9e604#") && str(?subtype) != "https://n2t.net/ark:/27023/9819f32405815dc7f2e0ecd9d8a9e604#Nanopub")
bind(strafter(str(?subtype), "#") as ?subtype_label)
}
graph ?ag {
?anno a oa:Annotation ;
oa:hasBody ?b ;
oa:hasTarget ?t .
?b rdf:value ?body_lit .
bind(str(?body_lit) as ?body)
bind(lang(?body_lit) as ?lang)
optional {
?t oa:hasScope ?scope .
bind(if(contains(str(?scope), "#"), strafter(str(?scope), "#"), str(?scope)) as ?scope_label)
}
optional {
?t oa:hasSource ?source .
bind(substr(replace(str(?source), "^.*/", ""), 1, 8) as ?source_label)
}
}
optional {
graph ?pg {
?ag prov:wasAttributedTo ?creator .
optional { ?creator rdfs:label ?creator_label }
optional {
?creator prov:actedOnBehalfOf ?group .
optional { ?group rdfs:label ?group_label }
}
}
}
}
order by desc(?datetime)
Returns all agenda items belonging to the given event, with label, description, related spaces, links, creator, and nanopub link.
Get agenda items for event
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?item ?item_label ?description (group_concat(distinct str(?space); separator=" ") as ?spaces_multi_iri) (group_concat(distinct concat('<span><a href="', str(?link), '">link</a></span>'); separator=", ") as ?link) ?creator ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
?np dct:created ?npdate .
?np dct:creator ?creator .
?np np:hasAssertion ?a .
?np npx:introduces ?item .
}
values ?_event_multi_iri {}
graph ?a {
?item a gen:AgendaItem .
?item dct:isPartOf ?_event_multi_iri .
optional { ?item rdfs:label ?item_label . }
optional { ?item dct:description ?description . }
optional { ?item schema:about ?space . }
optional { ?item rdfs:seeAlso ?link . }
}
}
group by ?item ?item_label ?description ?creator ?np ?npdate
order by asc(?npdate)
Returns all status updates belonging to the given event, with label, description, concerned spaces, links, creator, and nanopub link.
Get status updates for event
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?item ?item_label ?description (group_concat(distinct str(?space); separator=" ") as ?spaces_multi_iri) (group_concat(distinct concat('<span><a href="', str(?link), '">link</a></span>'); separator=", ") as ?link) ?creator ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
?np dct:created ?npdate .
?np dct:creator ?creator .
?np np:hasAssertion ?a .
?np npx:introduces ?item .
}
values ?_event_multi_iri {}
graph ?a {
?item a gen:StatusUpdate .
?item dct:isPartOf ?_event_multi_iri .
?item schema:about ?space .
optional { ?item rdfs:label ?item_label . }
optional { ?item dct:description ?description . }
optional { ?item rdfs:seeAlso ?link . }
}
}
group by ?item ?item_label ?description ?creator ?np ?npdate
order by asc(?npdate)
Will list all Snakemake report registrations created by this template: https://w3id.org/np/RAsmNjwvzjYfc8Hson0gyjSL6Oov3nZZEfRy7TOFtO5I8 - will need update if the template updates.
Snakemake Report Registrations
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
SELECT DISTINCT ?np ?date
WHERE {
# any triple (any graph) where the template appears as object
?np ?p <https://w3id.org/np/RAsmNjwvzjYfc8Hson0gyjSL6Oov3nZZEfRy7TOFtO5I8> .
# get its creation date (admin graph)
GRAPH npa:graph { ?np dct:created ?date }
}
LIMIT 100
Will return all workflow registered with https://w3id.org/np/RAOT7z3RA0XYlHIikne8rfUUYZrtHyrzXBD1HpI_GvcRk - might need updates from time to time.
Snakemake Workflow Registrations
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
SELECT DISTINCT ?np ?date
WHERE {
# any triple (any graph) where the template appears as object
?np ?p <https://w3id.org/np/RAOT7z3RA0XYlHIikne8rfUUYZrtHyrzXBD1HpI_GvcRk> .
# get its creation date (admin graph)
GRAPH npa:graph { ?np dct:created ?date }
}
LIMIT 100
This query returns the sub-resources of a Space or Maintained Resource.
Get sub-resources of Space or Maintained Resource
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?resource ?resource_label ?entity_main_type ?np where {
graph npa:graph {
values ?entity_main_type { gen:Space gen:MaintainedResource }
?np npx:hasNanopubType ?entity_main_type .
?np npx:introduces ?resource .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
filter not exists {
?np2 npx:introduces ?resource .
?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
?np2 dct:created ?date2 .
filter( ?date2 > ?date )
}
}
graph ?a {
{ {
values ?_super_resource_multi_iri {}
?resource a ?entity_main_type .
filter(strstarts(str(?resource), concat(str(?_super_resource_multi_iri), "/")))
bind(substr(str(?resource), strlen(str(?_super_resource_multi_iri)) + 2, strlen(str(?resource)) - strlen(str(?_super_resource_multi_iri)) - 1) as ?suffix)
filter(!contains(?suffix, "/"))
} union {
values ?_super_resource_multi_iri {}
?resource a gen:Space .
?resource dct:isPartOf ?_super_resource_multi_iri .
} union {
values ?_super_resource_multi_iri {}
?resource a gen:MaintainedResource .
?resource gen:isMaintainedBy ?_super_resource_multi_iri .
} }
filter exists { ?resource a ?__resource_type_iri }
?resource rdfs:label ?resource_label .
}
} order by ?resource_label
Returns all resource-to-archive-URL relations (Wikidata P1065), with the source nanopublication and creation timestamp, ordered by latest first.
Get archive URLs
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix wd: <http://www.wikidata.org/entity/>
select ?resource ?archive_url ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
?np np:hasAssertion ?a .
?np dct:created ?date .
}
graph ?a {
?resource wd:P1065 ?archive_url .
}
} order by desc(?date)
lists all nanopubs mentioning the Snakemake Workflow Management System
Snakemake Mentionings
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
prefix kpxl: <https://w3id.org/kpxl/gen/terms/>
SELECT DISTINCT ?np ?assertion ?p ?o
WHERE {
?np a np:Nanopublication ;
np:hasAssertion ?assertion .
GRAPH ?assertion {
?s ?p ?o .
FILTER (
isLiteral(?o) &&
REGEX(STR(?o), "snakemake", "i")
)
}
}
#LIMIT 100
Lists all significant persons (wd:P3342) for NFDI consortiums (wd:Q98270496), sorted by creation date (latest first).
Get significant persons for NFDI consortiums
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
prefix wd: <http://www.wikidata.org/entity/>
select ?consortium ?consortium_label ?person ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?pi .
?np dct:created ?date .
}
graph ?a {
?consortium a wd:Q98270496 ;
wd:P3342 ?person .
}
optional {
graph ?pi { ?consortium nt:hasLabelFromApi ?api_label . }
bind(if(contains(?api_label, " - "), strbefore(?api_label, " - "), ?api_label) as ?consortium_label)
}
}
order by desc(?date)
This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them.
Find GO FAIR qualified things
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
select distinct ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np (group_concat(distinct ?recommender; separator=" ") as ?recommenders) (group_concat(distinct ?recommendation_np; separator=" ") as ?recommendation_nps) (count(distinct ?recommender) as ?recommender_count) (sample(?fairAssessmentLevel) as ?fairAssessmentLevel) (sample(?fairAssessmentLevelNp) as ?fairAssessmentLevelNp) where {
graph npa:graph {
<https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk .
?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk .
filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . }
?latest_curators_np np:hasAssertion ?latest_curators_assertion .
}
graph npa:networkGraph {
?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> .
filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np }
}
graph npa:graph {
?np npx:hasNanopubType ?__type_iri .
?np npa:hasValidSignatureForPublicKey ?pubkey .
optional { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
optional { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np (npx:introduces|npx:describes) ?thing .
?np rdfs:label ?label .
?np dct:description ?description .
?np dct:created ?date .
filter(str(?date) > "2022")
}
bind(concat(" ",lcase(str(?label))," ",lcase(str(?description))," ") as ?text)
filter( contains(?text, lcase(str(?_searchterm))) )
optional {
graph npa:graph {
?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .
}
graph ?latest_curators_assertion {
?dpubkeys npx:hasPublicKey ?dpubkey .
}
graph npa:graph {
filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }
?disapproval np:hasAssertion ?da .
}
graph ?da {
?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .
}
} filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason
optional {
graph npa:graph {
?recommendation_np npx:hasNanopubType fip:recommended-by .
?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey .
filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . }
?recommendation_np np:hasAssertion ?ra .
?recommendation_np np:hasProvenance ?rp .
}
graph ?ra {
?thing fip:recommended-by ?recommender .
}
graph ?rp {
?ra prov:wasDerivedFrom ?rfip_np .
}
graph npa:graph {
?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .
?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .
?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .
filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . }
}
graph npa:networkGraph {
?latest_rfip_np (npx:supersedes)* ?rfip_np .
}
graph ?rfip_qa {
?rfip_qualifier npx:qualifies ?latest_rfip_np .
}
graph npa:graph {
?rfip_qualification_np np:hasAssertion ?rfip_qa .
?rfip_qualification_np npx:hasNanopubType npx:qualifies .
?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey .
filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . }
}
graph ?latest_curators_assertion {
?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey .
}
}
optional {
graph npa:graph {
?qualification_np npx:hasNanopubType npx:qualifies .
?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph ?latest_curators_assertion {
?qpubkeys npx:hasPublicKey ?qpubkey .
}
graph npa:graph {
filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . }
?qualification_np np:hasAssertion ?qa .
}
graph ?qa {
?qualifier npx:qualifies ?np .
}
}
optional {
graph npa:graph {
?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment .
?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey .
}
graph ?latest_curators_assertion {
?lpubkeys npx:hasPublicKey ?lpubkey .
}
graph npa:graph {
filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . }
?fairAssessmentLevelNp np:hasAssertion ?la .
}
graph ?la {
?thing fip:has-FAIR-assessment ?fairAssessmentLevel .
}
} filter(!bound(?levelNp)) # Faster than "filter not exists" for some reason
}
group by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np
order by desc(?recommender_count) asc(?label)
This query returns all RO-Crate nanopubs. Including the old and new type.
Get all RO-Crate nanopubs
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix kpxl: <https://w3id.org/kpxl/gen/terms/>
# find all ro-crates, with old and new nanopub type
select distinct ?rocrate ?date ?np where {
graph npa:graph {
{?np npx:hasNanopubType kpxl:RoCrateNanopub .} union {?np npx:hasNanopubType npx:RoCrateNanopub .}
?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyhash . }
?np dct:created ?date .
?np npx:introduces ?rocrate .
?np npx:signedBy ?agent_iri .
}
}
order by desc(?date)
This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them.
Find GO FAIR qualified things (only valid entries)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
select distinct ?thing ?label ?description ?np ?date ?pubkey ?qualifier ?qualification_np (group_concat(distinct ?recommender; separator=" ") as ?recommenders) (group_concat(distinct ?recommendation_np; separator=" ") as ?recommendation_nps) (count(distinct ?recommender) as ?recommender_count) (sample(?fairAssessmentLevel) as ?fairAssessmentLevel) (sample(?fairAssessmentLevelNp) as ?fairAssessmentLevelNp) where {
graph npa:graph {
<https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk .
?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk .
filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . }
?latest_curators_np np:hasAssertion ?latest_curators_assertion .
}
graph npa:networkGraph {
?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> .
filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np }
}
graph npa:graph {
?np npx:hasNanopubType ?__type_iri .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np (npx:introduces|npx:describes) ?thing .
?np rdfs:label ?label .
?np dct:description ?description .
?np dct:created ?date .
filter(str(?date) > "2022")
}
bind(concat(" ",lcase(str(?label))," ",lcase(str(?description))," ") as ?text)
filter( contains(?text, lcase(str(?_searchterm))) )
optional {
graph npa:graph {
?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .
}
graph ?latest_curators_assertion {
?dpubkeys npx:hasPublicKey ?dpubkey .
}
graph npa:graph {
filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }
?disapproval np:hasAssertion ?da .
}
graph ?da {
?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .
}
} filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason
optional {
graph npa:graph {
?recommendation_np npx:hasNanopubType fip:recommended-by .
?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey .
filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . }
?recommendation_np np:hasAssertion ?ra .
?recommendation_np np:hasProvenance ?rp .
}
graph ?ra {
?thing fip:recommended-by ?recommender .
}
graph ?rp {
?ra prov:wasDerivedFrom ?rfip_np .
}
graph npa:graph {
?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .
?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .
?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .
filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . }
}
graph npa:networkGraph {
?latest_rfip_np (npx:supersedes)* ?rfip_np .
}
graph ?rfip_qa {
?rfip_qualifier npx:qualifies ?latest_rfip_np .
}
graph npa:graph {
?rfip_qualification_np np:hasAssertion ?rfip_qa .
?rfip_qualification_np npx:hasNanopubType npx:qualifies .
?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey .
filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . }
}
graph ?latest_curators_assertion {
?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey .
}
}
optional {
graph npa:graph {
?qualification_np npx:hasNanopubType npx:qualifies .
?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph ?latest_curators_assertion {
?qpubkeys npx:hasPublicKey ?qpubkey .
}
graph npa:graph {
filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . }
?qualification_np np:hasAssertion ?qa .
}
graph ?qa {
?qualifier npx:qualifies ?np .
}
}
optional {
graph npa:graph {
?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment .
?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey .
}
graph ?latest_curators_assertion {
?lpubkeys npx:hasPublicKey ?lpubkey .
}
graph npa:graph {
filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . }
?fairAssessmentLevelNp np:hasAssertion ?la .
}
graph ?la {
?thing fip:has-FAIR-assessment ?fairAssessmentLevel .
}
} filter(!bound(?levelNp)) # Faster than "filter not exists" for some reason
}
group by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np
order by desc(?recommender_count) asc(?label)
This query returns all RO-Crate nanopubs.
Get all RO-Crate Nanopubs (new type)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix kpxl: <https://w3id.org/kpxl/gen/terms/> select distinct ?rocrate ?date (?__agent_iri as ?agent) ?np (?__pubkeyhash as ?pubkey) where { graph npa:graph { ?np npx:hasNanopubType kpxl:RoCrateNanopub . ?np npa:hasValidSignatureForPublicKeyHash ?__pubkeyhash . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkeyhash . } ?np dct:created ?date . ?np npx:introduces ?rocrate . ?np npx:signedBy ?__agent_iri . } } order by desc(?date)
This query returns all RO-Crate nanopubs.
Get all RO-Crate Nanopubs (new type)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix kpxl: <https://w3id.org/kpxl/gen/terms/> select distinct ?rocrate ?date (?__agent_iri as ?agent) ?np (?__pubkeyhash as ?pubkey) where { graph npa:graph { ?np npx:hasNanopubType kpxl:RoCrateNanopub . ?np npa:hasValidSignatureForPublicKeyHash ?__pubkeyhash . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkeyhash . } ?np dct:created ?date . ?np npx:introduces ?rocrate . ?np npx:signedBy ?__agent_iri . } } order by desc(?date)
This query returns all RO-Crate nanopubs.
Get all RO-Crate Nanopubs (old type)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>prefix dct: <http://purl.org/dc/terms/>prefix np: <http://www.nanopub.org/nschema#>prefix npa: <http://purl.org/nanopub/admin/>prefix npx: <http://purl.org/nanopub/x/>select distinct ?rocrate ?date ?np where { graph npa:graph { ?np npx:hasNanopubType npx:RoCrateNanopub . filter not exists { ?npx npx:invalidates ?np } ?np dct:created ?date . ?np npx:introduces ?rocrate . }}order by desc(?date)
This query returns all RO-Crate nanopubs.
Get all RO-Crate Nanopubs (old type)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>prefix dct: <http://purl.org/dc/terms/>prefix np: <http://www.nanopub.org/nschema#>prefix npa: <http://purl.org/nanopub/admin/>prefix npx: <http://purl.org/nanopub/x/>select distinct ?rocrate ?date ?np where { graph npa:graph { ?np npx:hasNanopubType npx:RoCrateNanopub . filter not exists { ?npx npx:invalidates ?np } ?np dct:created ?date . ?np npx:introduces ?rocrate . }}order by desc(?date)
This query returns all RO-Crate nanopubs.
Get all RO-Crate Nanopubs (old type)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>prefix dct: <http://purl.org/dc/terms/>prefix np: <http://www.nanopub.org/nschema#>prefix npa: <http://purl.org/nanopub/admin/>prefix npx: <http://purl.org/nanopub/x/>select distinct ?rocrate ?date ?np where { graph npa:graph { ?np npx:hasNanopubType npx:RoCrateNanopub . filter not exists { ?npx npx:invalidates ?np } ?np dct:created ?date . ?np npx:introduces ?rocrate . }}order by desc(?date)
This query returns all FIP declarations that are part of the most recent versions of the FIP indexes, as these nanopubs are produced by the FIP Wizard.
Get FIP declarations in indexes
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix dct: <http://purl.org/dc/terms/>
prefix dce: <http://purl.org/dc/elements/1.1/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix np: <http://www.nanopub.org/nschema#>
prefix prov: <http://www.w3.org/ns/prov#>
select ?fip_index ?fip_title ?fip_source ?decl_np where {
graph npa:graph {
?fip_index npx:hasNanopubType npx:NanopubIndex .
?fip_index npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?index_np_x npx:invalidates ?fip_index ; npa:hasValidSignatureForPublicKey ?pubkey . }
?fip_index np:hasAssertion ?index_a .
?fip_index np:hasPublicationInfo ?index_i .
?fip_index rdfs:label ?fip_title .
?fip_index dct:created ?index_date .
?decl_np npa:hasValidSignatureForPublicKey ?decl_pubkey .
filter not exists { ?decl_np_x npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?decl_pubkey . }
?decl_np npx:hasNanopubType fip:FIP-Declaration .
?decl_np dct:created ?date .
}
graph ?index_a {
?fip_index npx:includesElement ?decl_np .
}
graph ?index_i {
?fip_index prov:wasDerivedFrom ?fip_source .
}
filter not exists {
graph npa:graph { # Moving this to a separate graph for performance reasons with RDF4J LMDB engine
# Matching on the title string is an ugly hack:
?fip_newer_index rdfs:label ?fip_title .
}
graph npa:graph {
?fip_newer_index npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?fip_newer_index_x npx:invalidates ?fip_newer_index ; npa:hasValidSignatureForPublicKey ?pubkey . }
?fip_newer_index dct:created ?newer_date .
}
filter(?newer_date > ?index_date).
}
}
Lists all entities that have been annotated by nanopubs containing oa:Annotation, ordered by the number of annotation nanopubs targeting each entity.
Get annotated entities
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix oa: <http://www.w3.org/ns/oa#>
select ?entity (count(?np) as ?annotation_count)
(group_concat(str(?np); separator=" ") as ?nps_multi_iri)
(group_concat("^"; separator="\n") as ?nps_label_multi)
where {
{
select distinct ?entity ?np where {
graph npa:graph {
?np np:hasAssertion ?a .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
}
graph ?a {
?annotation a oa:Annotation ;
oa:hasTarget ?target .
?target oa:hasSource ?entity .
}
}
}
}
group by ?entity
order by desc(?annotation_count)
This query returns the papers co-authored by team members of a given Space.
Get papers for team
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix fabio: <http://purl.org/spar/fabio/>
prefix bibo: <http://purl.org/ontology/bibo/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select distinct ?paper ?paper_label ?journal ?journal_label ?publication_date ?np ("^" as ?np_label) where {
values ?_space_multi_iri {}
graph npa:graph {
?mnp npa:hasValidSignatureForPublicKeyHash ?mpubkey .
filter not exists { ?mnpx npx:invalidates ?mnp ; npa:hasValidSignatureForPublicKeyHash ?mpubkey . }
?mnp np:hasAssertion ?ma .
}
graph ?ma {
?_space_multi_iri gen:hasTeamMember ?author .
}
graph npa:graph {
?np npx:hasNanopubType fabio:ScholarlyWork .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
?np npx:introduces ?paper .
}
graph ?a {
?paper dct:title ?paper_label .
?paper bibo:authorList ?author_list .
?paper dct:date ?publication_date .
?author_list ?rdfseqpred ?author .
filter(strstarts(str(?rdfseqpred), "http://www.w3.org/1999/02/22-rdf-syntax-ns#_"))
optional {
?paper dct:isPartOf ?journal .
?journal dct:title ?journal_label .
}
}
}
order by desc(?publication_date)
Full-text search over classes that have been declared as FAIR Digital Object (FDO) subclasses in nanopublications. Suitable as an autocomplete lookup source in Nanodash guided-choice placeholders.
Full-text search on FDO subclasses
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
prefix fdof: <https://w3id.org/fdof/ontology#>
select distinct ?thing ?label ?description ?np ?pubkey ?date where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np dct:created ?date .
?np npx:introduces|npx:describes|npx:embeds ?thing .
?np rdfs:label ?label .
optional { ?np dct:description ?description . }
?np np:hasAssertion ?a .
}
graph ?a {
?thing rdfs:subClassOf fdof:FAIRDigitalObject .
}
filter(contains(lcase(str(?label)), lcase(?_query)))
}
order by desc(?date)
limit 10
Returns the pinned templates for the given resource (Space, agent, or other resource), formatted for list display.
Get pinned templates for resource
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?label ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np npx:hasNanopubType gen:hasPinnedTemplate .
?np dct:created ?date .
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?pi .
}
graph ?a {
values ?_resource_multi_iri {}
?_resource_multi_iri gen:hasPinnedTemplate ?template .
}
optional { graph ?pi { ?template nt:hasLabelFromApi ?api_label } }
bind(if(bound(?api_label),
if(contains(?api_label, " - "), strbefore(?api_label, " - "), ?api_label),
str(?template)) as ?rawlabel)
bind(concat("<span><a href=\"/publish?template=", encode_for_uri(str(?template)), "\">", ?rawlabel, "</a></span>") as ?label)
} order by desc(?date)
Returns the pinned queries for the given resource (Space, agent, or other resource), formatted for list display.
Get pinned queries for resource
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?label ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np npx:hasNanopubType gen:hasPinnedQuery .
?np dct:created ?date .
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?pi .
}
graph ?a {
values ?_resource_multi_iri {}
?_resource_multi_iri gen:hasPinnedQuery ?query .
}
optional { graph ?pi { ?query nt:hasLabelFromApi ?api_label } }
bind(if(bound(?api_label),
if(contains(?api_label, " - "), strbefore(?api_label, " - "), ?api_label),
str(?query)) as ?rawlabel)
bind(replace(str(?query), "https://w3id.org/np/", "") as ?spec_path)
bind(concat("<span><a href=\"/query?id=", ?spec_path, "\">", ?rawlabel, "</a></span>") as ?label)
} order by desc(?date)
Returns the grlc query nanopublications created by the given user.
Get queries by given user
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix grlc: <https://w3id.org/kpxl/grlc/>
select ?label ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npx:signedBy ?_user_iri .
?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . }
?np npx:hasNanopubType grlc:grlc-query .
?np npx:introduces|npx:embeds ?query .
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
?query grlc:endpoint ?endpoint .
filter(strstarts(str(?endpoint), "https://w3id.org/np/l/nanopub-query"))
optional { ?query rdfs:label ?rawlabel }
}
bind(replace(str(?query), "https://w3id.org/np/", "") as ?spec_path)
bind(concat("<span><a href=\"/query?id=", ?spec_path, "\">", coalesce(?rawlabel, str(?query)), "</a></span>") as ?label)
} order by desc(?date)
Returns the assertion templates created by the given user.
Get templates by given user
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?label ?tag ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npx:signedBy ?_user_iri .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np npx:hasNanopubType nt:AssertionTemplate .
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
?a rdfs:label ?rawlabel .
optional { ?a nt:hasTag ?tag . }
filter not exists { ?a a nt:UnlistedTemplate }
}
bind(concat("<span><a href=\"/publish?template=", encode_for_uri(str(?np)), "\">", ?rawlabel, "</a></span>") as ?label)
} order by desc(?date)
This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them.
Find GO FAIR qualified vocabularies/ontologies
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
select distinct ?thing ?label ?types ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np (group_concat(distinct ?recommender; separator=" ") as ?recommenders) (group_concat(distinct ?recommendation_np; separator=" ") as ?recommendation_nps) (count(distinct ?recommender) as ?recommender_count) (sample(?fairAssessmentLevel) as ?fairAssessmentLevel) (sample(?fairAssessmentLevelNp) as ?fairAssessmentLevelNp) where {
{
SELECT ?np (GROUP_CONCAT(DISTINCT ?filteredType; separator=" ") AS ?types) WHERE {
GRAPH npa:graph {
VALUES ?filteredType { fip:Semantic-model fip:Structured-vocabulary }
?np npx:hasNanopubType ?filteredType .
}
} GROUP BY ?np
}
graph npa:graph {
<https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk .
?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk .
filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . }
?latest_curators_np np:hasAssertion ?latest_curators_assertion .
}
graph npa:networkGraph {
?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> .
filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np }
}
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
optional { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
optional { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np (npx:introduces|npx:describes) ?thing .
?np rdfs:label ?label .
?np dct:description ?description .
?np dct:created ?date .
filter(str(?date) > "2022")
}
bind(concat(" ",lcase(str(?label))," ",lcase(str(?description))," ") as ?text)
filter( contains(?text, lcase(str(?_searchterm))) )
optional {
graph npa:graph {
?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .
}
graph ?latest_curators_assertion {
?dpubkeys npx:hasPublicKey ?dpubkey .
}
graph npa:graph {
filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }
?disapproval np:hasAssertion ?da .
}
graph ?da {
?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .
}
} filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason
optional {
optional {
graph npa:graph {
?recommendation_np npx:hasNanopubType fip:recommended-by .
?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey .
filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . }
?recommendation_np np:hasAssertion ?ra .
?recommendation_np np:hasProvenance ?rp .
}
graph ?ra {
?thing fip:recommended-by ?recommender .
}
graph ?rp {
?ra prov:wasDerivedFrom ?rfip_np .
}
graph npa:graph {
?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .
?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .
?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .
filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . }
}
graph npa:networkGraph {
?latest_rfip_np (npx:supersedes)* ?rfip_np .
}
graph ?rfip_qa {
?rfip_qualifier npx:qualifies ?latest_rfip_np .
}
graph npa:graph {
?rfip_qualification_np np:hasAssertion ?rfip_qa .
?rfip_qualification_np npx:hasNanopubType npx:qualifies .
?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey .
filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . }
}
graph ?latest_curators_assertion {
?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey .
}
}
graph npa:graph {
?qualification_np npx:hasNanopubType npx:qualifies .
?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph ?latest_curators_assertion {
?qpubkeys npx:hasPublicKey ?qpubkey .
}
graph npa:graph {
filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . }
?qualification_np np:hasAssertion ?qa .
}
graph ?qa {
?qualifier npx:qualifies ?np .
}
}
optional {
graph npa:graph {
?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment .
?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey .
}
graph ?latest_curators_assertion {
?lpubkeys npx:hasPublicKey ?lpubkey .
}
graph npa:graph {
filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . }
?fairAssessmentLevelNp np:hasAssertion ?la .
}
graph ?la {
?thing fip:has-FAIR-assessment ?fairAssessmentLevel .
}
} filter(!bound(?levelNp)) # Faster than "filter not exists" for some reason
}
group by ?thing ?label ?types ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np
order by desc(?recommender_count) asc(?label)
This query summarises statistics for the assessed LLM-KG integration papers, returning the average number of described and discussed methods, along with the % of papers that have the source code link in the text.
Get summary statistics for assessed LLM-KG papers
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX cito: <http://purl.org/spar/cito/>
PREFIX fabio: <http://purl.org/spar/fabio/>
PREFIX npx: <http://purl.org/nanopub/x/>
SELECT
(STR(ROUND(AVG(?describedCount) * 100) / 100) AS ?AvgDescribedMethods)
(STR(ROUND(AVG(?discussedCount) * 100) / 100) AS ?AvgDiscussedMethods)
(CONCAT(STR(ROUND((SUM(?hasUrl) / COUNT(?paper)) * 100)), "%") AS ?PercentPapersWithSourceCodeURL)
WHERE {
{
SELECT ?paper
(COUNT(DISTINCT ?desc) AS ?describedCount)
(COUNT(DISTINCT ?disc) AS ?discussedCount)
(MAX(IF(BOUND(?methodUrl), 1, 0)) AS ?hasUrl)
WHERE {
?np a np:Nanopublication ;
np:hasAssertion ?assertion .
FILTER NOT EXISTS {
?newerNp npx:supersedes ?np .
}
GRAPH ?assertion {
?paper a prov:Entity .
OPTIONAL {
?paper cito:describes ?desc .
OPTIONAL { ?desc fabio:hasURL ?methodUrl . }
}
OPTIONAL { ?paper cito:discusses ?disc . }
}
}
GROUP BY ?paper
}
}
This query returns the distribution of unique research papers across the two-tier hierarchy of LLM-KG integration, excluding all superseded assessments.
Get counts of assessed LLM-KG papers per assigned category
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX cito: <http://purl.org/spar/cito/>
SELECT ?TopCategory ?Category (STR(COUNT(DISTINCT ?paper)) AS ?PaperCount) (SAMPLE(?np) AS ?Example)
WHERE {
?np a np:Nanopublication ;
np:hasAssertion ?assertionGraph .
FILTER NOT EXISTS {
?newerNp npx:supersedes ?np .
}
GRAPH ?assertionGraph {
?paper a prov:Entity ;
cito:describes ?method .
?method dct:subject ?catUri ;
<https://neverblink.eu/ontologies/llm-kg/hasTopCategory> ?topUri .
BIND(REPLACE(STR(?topUri), "^.*#", "") AS ?TopCategory)
BIND(REPLACE(STR(?catUri), "^.*#", "") AS ?Category)
}
}
GROUP BY ?TopCategory ?Category
ORDER BY ?TopCategory
This query returns the testimonials (about any entity) authored by any of the project leads of the given project.
Get testimonials by project leads
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <https://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?author ?author_label ?about ?about_label ?text ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?lead_np np:hasAssertion ?lead_a .
?lead_np npa:hasValidSignatureForPublicKeyHash ?lead_pubkey .
filter not exists { ?lead_npx npx:invalidates ?lead_np ; npa:hasValidSignatureForPublicKeyHash ?lead_pubkey . }
}
graph ?lead_a {
?_project_iri gen:hasProjectLead ?author .
}
graph npa:graph {
?np npx:hasNanopubType gen:Testimonial .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx2 npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np npx:introduces ?testimonial .
?np np:hasAssertion ?a .
?np dct:created ?date .
}
graph ?a {
?testimonial dct:description ?text .
?testimonial schema:author ?author .
optional { ?testimonial schema:about ?about . }
optional { ?author rdfs:label ?author_label . }
optional { ?about rdfs:label ?about_label . }
}
}
order by desc(?date)
This query returns all classes that specify to be part of a given ontology.
Get the classes of an ontology
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
select ?class ?class_label (?definition as ?description)
(group_concat(distinct str(?superclass); separator=" ") as ?superclasses_multi_iri)
(group_concat(distinct replace(replace(coalesce(?superclass_lbl, str(?superclass)), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as
?superclasses_label_multi)
?np ("^" as ?np_label) where {
values ?_ontology_multi_iri {}
graph npa:graph {
?np npx:hasNanopubType owl:Class .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np npx:introduces ?class .
?np np:hasAssertion ?a .
}
graph ?a {
?class dct:partOf ?_ontology_multi_iri .
optional { ?class rdfs:label ?class_label . }
optional { ?class skos:definition ?definition . }
optional {
?class rdfs:subClassOf ?superclass .
filter(isIRI(?superclass))
optional { ?superclass rdfs:label ?superclass_lbl . }
}
}
}
group by ?class ?class_label ?definition ?np
order by ?class_label
This query returns all classes that specify to be part of a given ontology.
Get the classes of an ontology
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
select ?class ?class_label (?definition as ?description)
(group_concat(distinct str(?superclass); separator=" ") as ?superclasses_multi_iri)
(group_concat(distinct replace(replace(coalesce(?superclass_lbl, str(?superclass)), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as
?superclasses_label_multi)
?np ("^" as ?np_label)
where {
values ?_ontology_multi_iri {}
graph npa:graph {
?np npx:hasNanopubType owl:Class .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np npx:introduces ?class .
?np np:hasAssertion ?a .
}
graph ?a {
?class dct:partOf ?_ontology_multi_iri .
optional { ?class rdfs:label ?class_label . }
optional { ?class skos:definition ?definition . }
optional {
?class rdfs:subClassOf ?superclass .
filter(isIRI(?superclass))
optional { ?superclass rdfs:label ?superclass_lbl . }
}
}
}
group by ?class ?class_label ?definition ?np
order by ?class_label
Returns all assertion templates with their label, tag, creator and date, ordered by descending date
Get all templates
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?template_iri ?template_iri_label ?tag ?creator ?date where {
graph npa:graph {
?template_iri npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?template_iri ; npa:hasValidSignatureForPublicKey ?pubkey . }
?template_iri npx:hasNanopubType nt:AssertionTemplate .
?template_iri dct:created ?date .
?template_iri np:hasAssertion ?a .
optional { ?template_iri npx:signedBy ?creator . }
}
optional { graph ?a { ?a rdfs:label ?template_iri_label } }
optional { graph ?a { ?a nt:hasTag ?tag . } }
filter not exists { graph ?a { ?a a nt:UnlistedTemplate } }
} order by desc(?date)
This query returns the most used assertion templates of the last 30 days, considering the latest versions of these templates.
Get the most used templates of the last 30 days
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
prefix dct: <http://purl.org/dc/terms/>
select ?template_np ?template_np_label (sum(?npcount) as ?overallcount) {
{ select ?used_template_np (count(distinct ?np) as ?npcount) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np np:hasPublicationInfo ?i .
}
graph ?i {
?np nt:wasCreatedFromTemplate ?used_template_np .
}
} group by ?used_template_np }
bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(nt:AssertionTemplate)))) as ?atservice)
{ service ?atservice {
graph npa:networkGraph {
?template_np npx:supersedes* ?used_template_np .
}
graph npa:graph {
?used_template_np npa:hasValidSignatureForPublicKey ?pubkey .
?template_np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?template_npx npx:invalidates ?template_np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?used_template_np np:hasAssertion ?a .
}
graph ?a {
?a rdfs:label ?template_np_label .
}
} }
} group by ?template_np ?template_np_label order by desc(?overallcount) limit 10
Returns the latest nanopublications signed by or created by a given user (signed via npx:signedBy, or created via dct:creator if no npx:signedBy is present).
Get latest nanopublications by user
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
select ?np ?date where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np dct:created ?date .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:retracts . }
}
{
graph npa:graph {
?np npx:signedBy ?_userid_iri .
}
} union {
filter not exists {
graph npa:graph { ?np npx:signedBy ?anyuser . }
}
graph npa:graph {
?np dct:creator ?_userid_iri .
}
}
}
order by desc(?date)
limit 100
Returns the latest nanopublications signed by or created by a given user (signed via npx:signedBy, or created via dct:creator if no npx:signedBy is present).
Get latest nanopublications by user
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
select ?np ?date where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np dct:created ?date .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:retracts . }
}
{
graph npa:graph {
?np npx:signedBy ?_userid_iri .
}
} union {
filter not exists {
graph npa:graph { ?np npx:signedBy ?_userid_iri . }
}
graph npa:graph {
?np dct:creator ?_userid_iri .
}
}
}
order by desc(?date)
limit 100
Returns the latest users who have introduced themselves, with the user IRI in the user_iri column for display.
Get latest users v2
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix dct: <http://purl.org/dc/terms/>
select ?user_iri where {
{
select ?user_iri (min(?date) as ?mindate) where {
graph npa:graph {
?intronp npa:hasValidSignatureForPublicKey ?introPubkey .
filter not exists { ?intronpx npx:retracts ?intronp ; npa:hasValidSignatureForPublicKey ?pubkey . }
filter not exists { ?intronp npx:supersedes ?intronpx . }
?intronp dct:created ?date .
?intronp np:hasAssertion ?a .
}
graph ?a {
?keydeclaration npx:declaredBy ?user_iri .
?keydeclaration npx:hasPublicKey ?pubkey .
}
}
group by ?user_iri
}
}
order by desc(?mindate)
limit 100
This query returns a list of suggested templates to get started, so it can be shown e.g. on Nanodash.
Get suggested templates to get started
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
select ?template_iri ?template_iri_label where {
graph npa:graph {
?np npx:hasNanopubType <https://w3id.org/kpxl/gen/terms/SuggestedTemplateToGetStarted> .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter(?pubkey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD4Wj537OijfOWVtsHMznuXKISqBhtGDQZfdO6pbb4hg9EHMcUFGTLbWaPrP783PHv8HMAAPjvEkHLaOHMIknqhaIa5236lfBO3r+ljVdYBElBcLvROmwG+ZGtmPNZf7lMhI15xf5TfoaSa84AFRd5J2EXekK6PhaFQhRm1IpSYtwIDAQAB")
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
?template_iri a <https://w3id.org/kpxl/gen/terms/SuggestedTemplateToGetStarted> .
}
optional {
graph npa:graph {
?template_iri rdfs:label ?raw_label .
}
bind(replace(str(?raw_label), "^Template: ", "") as ?template_iri_label)
}
} order by desc(?date)
This query returns a list of suggested templates to get started, so it can be shown e.g. on Nanodash.
Get suggested templates to get started
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
select ?template_iri ?template_iri_label where {
graph npa:graph {
?np npx:hasNanopubType <https://w3id.org/kpxl/gen/terms/SuggestedTemplateToGetStarted> .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
}
graph ?a {
?template_iri a <https://w3id.org/kpxl/gen/terms/SuggestedTemplateToGetStarted> .
optional { ?template_iri rdfs:label ?template_iri_label . }
}
} order by desc(?date)
This query returns the 10 creators who created most nanopublications during the last 30 days.
Get the top-10 creators of the last 30 days
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix prov: <http://www.w3.org/ns/prov#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select ?user_iri where {
{ graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np dct:creator ?user_iri .
} }
union
{
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np np:hasAssertion ?assertion .
?np np:hasProvenance ?prov .
}
graph ?prov {
?assertion prov:wasAttributedTo ?user_iri .
}
}
filter(?user_iri != <https://orcid.org/1234-1234-1234-1234>)
filter(?user_iri != <https://orcid.org/0000-0000-0000-0000>)
filter(!regex(str(?user_iri), '[^A-Za-z0-9-_]RA[A-Za-z0-9-_]{43}$'))
}
group by ?user_iri
order by desc(count(distinct ?np))
limit 10
This query returns the testimonials about the given entity.
Get testimonials about entity
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <https://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?author ?author_label ?text ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npx:hasNanopubType gen:Testimonial .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np npx:introduces ?testimonial .
?np np:hasAssertion ?a .
?np dct:created ?date .
}
graph ?a {
?testimonial dct:description ?text .
values ?_subject_multi_iri {}
?testimonial schema:about ?_subject_multi_iri .
?testimonial schema:author ?author .
optional { ?author rdfs:label ?author_label . }
}
}
order by desc(?date)
This query returns the testimonials by the given author.
Get testimonials by author
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <https://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?about ?text ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npx:hasNanopubType gen:Testimonial .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np npx:introduces ?testimonial .
?np np:hasAssertion ?a .
?np dct:created ?date .
}
graph ?a {
?testimonial dct:description ?text .
?testimonial schema:author ?_author_iri .
optional { ?testimonial schema:about ?about . }
}
}
order by desc(?date)
Returns R-FIP declarations: FIP declarations whose community has a Reference-FAIR-Implementation-Profile, matched with the latest R-FIP profile for that community.
Get R-FIP declarations in context
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix dct: <http://purl.org/dc/terms/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix np: <http://www.nanopub.org/nschema#>
prefix schema: <https://schema.org/>
select ?fip_index ?fip_title ?decl_np where {
# Find R-FIP profiles (latest per community)
graph npa:graph {
?fip_index npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .
?fip_index npa:hasValidSignatureForPublicKeyHash ?pkh .
filter not exists { ?inv npx:invalidates ?fip_index ; npa:hasValidSignatureForPublicKeyHash ?pkh . }
?fip_index np:hasAssertion ?rfip_a .
?fip_index npx:introduces ?rfip .
?fip_index dct:created ?rfip_date .
}
graph ?rfip_a {
?rfip rdfs:label ?fip_title .
?rfip fip:declared-by ?community .
}
# Keep only the latest R-FIP profile per community
filter not exists {
graph npa:graph {
?newer_rfip npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .
?newer_rfip npa:hasValidSignatureForPublicKeyHash ?nkh .
filter not exists { ?ninv npx:invalidates ?newer_rfip ; npa:hasValidSignatureForPublicKeyHash ?nkh . }
?newer_rfip np:hasAssertion ?nra .
?newer_rfip dct:created ?newer_date .
}
graph ?nra {
?nrfip fip:declared-by ?community .
}
filter(?newer_date > ?rfip_date)
}
# Find FIP declarations from these R-FIP communities that have schema:version
graph npa:graph {
?decl_np npx:hasNanopubType fip:FIP-Declaration .
?decl_np npa:hasValidSignatureForPublicKey ?dpk .
filter not exists { ?dinv npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?dpk . }
?decl_np np:hasAssertion ?decl_a .
}
graph ?decl_a {
?decl fip:declared-by ?community .
?decl schema:version ?version .
}
}
This query returns the relevant resources for a given entity (e.g. a Space).
Get relevant resources
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?resource ?resource_label ?comment ?np ("^" as ?np_label) where {
graph npa:graph {
?np npx:hasNanopubType gen:isRelevantFor .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np np:hasAssertion ?a .
optional { ?np rdfs:label ?label }
}
values ?_entity_multi_iri {}
graph ?a {
?resource gen:isRelevantFor ?_entity_multi_iri .
optional { ?resource rdfs:label ?resource_label . }
optional { ?resource rdfs:comment ?comment . }
}
}
This query returns the paragraphs of an entity (e.g. a space) with their title and content, including source nanopub and date.
Get paragraphs of an entity
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix schema: <http://schema.org/>
prefix schemas: <https://schema.org/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>
select ?title ?content ?date ?np where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np dct:creator ?user .
?np np:hasAssertion ?a .
}
graph ?a {
?paragraph schema:title|schemas:title ?title .
?paragraph rdf:type gen:Paragraph .
?paragraph gen:hasContent ?content .
values ?_resource_multi_iri {}
?paragraph schema:isPartOf|schemas:isPartOf|schema:about|schemas:about ?_resource_multi_iri .
optional { ?paragraph gen:hasPositionString ?position }
}
}
order by ?position ?title
This query returns all newer versions of a given nanopublication, including those that since have been superseded or retracted.
Get all newer versions of this nanopublication
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
select ?newerVersion ?date ?retractedBy ?supersededBy where {
graph npa:graph {
?_np_iri npa:hasValidSignatureForPublicKey ?pubkey .
}
graph npa:networkGraph {
?newerVersion (npx:supersedes)* ?_np_iri .
}
graph npa:graph {
?newerVersion npa:hasValidSignatureForPublicKey ?pubkey .
}
optional { graph npa:graph { ?newerVersion dct:created ?date . } }
optional { graph npa:graph { ?retractedBy npx:retracts ?newerVersion ; npa:hasValidSignatureForPublicKey ?pubkey . } }
optional { graph npa:graph { ?supersededBy npx:supersedes ?newerVersion ; npa:hasValidSignatureForPublicKey ?pubkey . } }
}
order by desc(?date) ?newerVersion
This query returns the items a given user has read, covering both schema:ReadAction and paperclub:hasRead nanopubs.
Get reads by reader
prefix schema: <http://schema.org/>
prefix pc: <http://purl.org/petapico/o/paperclub#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
select distinct ?item ?item_label ?date ?comment ?np ("^" as ?np_label) where {
{
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np np:hasAssertion ?a .
?np dct:created ?created .
}
graph ?a {
?ra a schema:ReadAction ;
schema:agent ?_reader_iri ;
schema:object ?item .
optional { ?item rdfs:label ?item_label }
optional { ?ra schema:endTime ?d }
optional { ?ra rdfs:comment ?comment }
}
bind(coalesce(?d, substr(str(?created), 1, 10)) as ?date)
}
union
{
bind(iri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(pc:hasRead)))) as ?hasread_repo)
service ?hasread_repo {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np np:hasAssertion ?a .
?np npx:signedBy ?_reader_iri .
?np dct:created ?created .
}
graph ?a {
?_reader_iri pc:hasRead ?item .
optional { ?item rdfs:comment ?comment }
}
}
bind(substr(str(?created), 1, 10) as ?date)
}
} order by desc(?date)
This query returns all thanks, possibly restricted by thanker, thanked, and/or thank reason.
Get thanks
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix thank: <https://w3id.org/spaces/nanopub/r/thank/>
select (?__thanker_iri as ?thanker) (?__thanked_iri as ?thanked) (?__thankReason_iri as ?thank_reason) ?comment ?date ?np ("^" as ?np_label) where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np dct:created ?date .
?np npx:signedBy ?__thanker_iri .
?np np:hasAssertion ?a .
}
graph ?a {
?thanks a thank:Thanks .
?thanks thank:hasThanked ?__thanked_iri .
?thanks thank:hasThanker ?__thanker_iri .
?thanks thank:thanksFor ?__thankReason_iri .
optional { ?thanks rdfs:comment ?comment . }
}
}
order by desc(?date)
Returns all 3PFF events for a given user, including the role they had in each event.
Get 3PFF events for user
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix dct: <http://purl.org/dc/terms/>
prefix tpff: <https://w3id.org/fair/3pff/>
prefix schema: <http://schema.org/>
select ?event ?event_label (sample(?ev_name) as ?event_name) (sample(?ev_date) as ?event_date) ?roles_multi_iri ?roles_label_multi ?np_multi_iri ?np_label_multi where {
{
select ?event (replace(str(?event), "^.*/", "") as ?event_label) (group_concat(str(?role); separator=" ") as ?roles_multi_iri) (group_concat(?role_label; separator="\n") as ?roles_label_multi) (group_concat(str(?latest_np); separator=" ") as ?np_multi_iri) (group_concat("^"; separator="\n") as ?np_label_multi) where {
{
select ?event ?role ?role_label (sample(?np) as ?latest_np) where {
values (?role ?role_label) {
(tpff:participatedAsParticipantIn "Participant")
(tpff:participatedAsFacilitatorIn "Facilitator")
(tpff:participatedAsTrainerIn "Trainer")
(tpff:participatedAsFacilitatorAssistantIn "Facilitator Assistant")
(tpff:participatedAsTrainerAssistantIn "Trainer Assistant")
(tpff:participatedAsImplementerIn "Implementer")
(tpff:participatedAsImplementerAspirantIn "Implementer Aspirant")
}
graph npa:graph {
?np npx:hasNanopubType ?role .
?np dct:creator ?_user_iri .
?np npa:hasValidSignatureForPublicKeyHash ?pk .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pk . }
?np np:hasAssertion ?a .
?np dct:created ?date .
}
graph ?a {
?_user_iri ?role ?event .
}
filter not exists {
graph npa:graph {
?np2 npx:hasNanopubType ?role .
?np2 dct:creator ?_user_iri .
?np2 npa:hasValidSignatureForPublicKeyHash ?pk2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pk2 . }
?np2 np:hasAssertion ?a2 .
?np2 dct:created ?date2 .
filter(?date2 > ?date)
}
graph ?a2 {
?_user_iri ?role ?event .
}
}
}
group by ?event ?role ?role_label
}
}
group by ?event
}
graph npa:graph {
?enp npx:introduces ?event .
?enp npa:hasValidSignatureForPublicKeyHash ?epk .
filter not exists { ?enpx npx:invalidates ?enp ; npa:hasValidSignatureForPublicKeyHash ?epk . }
?enp np:hasAssertion ?ea .
}
graph ?ea {
?event a tpff:3PFF-event .
?event rdfs:label ?ename .
optional { ?event dct:date ?dateDct . }
optional { ?event schema:startDate ?dateSchema . }
}
bind(coalesce(?dateDct, strBefore(str(?dateSchema), "T")) as ?ev_date)
bind(replace(?ename, "^[^|]*\\| ?", "") as ?ev_name)
}
group by ?event ?event_label ?roles_multi_iri ?roles_label_multi ?np_multi_iri ?np_label_multi
order by desc(sample(?ev_date))