Did you know ... Search Documentation:
Pack sparqlprog -- prolog/sparqlprog/ontologies/dbpedia/dbpedia_matcher.pl
PublicShow source

This module is intended primarily as an example of how to mix local logic and remote sparql logic.

 has_shared_band_member(?B1, ?B2, ?SharedMember) is nondet
links bands by members in common. E.g. Ronnie James Dio in both Rainbow and Black Sabbath

true if SharedMember is a member of both B1 and B2 (and B1 and B2 are distinct)

 has_shared_genre(?B1, ?B2, ?SharedGenre) is nondet
links bands by shared genre common.

true if SharedGenre is a genre of both B1 and B2 (and B1 and B2 are distinct)

 similarity_by_genre(?BandA, ?BandB, ?SumIC)
calculates the jaccard similarity between two entities based on genres in common

the entities should be of similar types (e.g. two bands, or two books)

| genres(A) /\ genres(B) | / | genres(A) \/ genres(B) |

if no genres are in common, then this should equal 0 if all genres are in common, then this should equal 1

note this does not take into account how meaningful it is for a genre to be shared; e.g. sharing the common genre 'pop' counts as much as a rarer genre like 'psytrance'. see further on for IC-based metrics.

 pair_genre_sum_ic(?BandA, ?BandB, ?SumIC)
for a pair of bands, SumIC is the sum of the ICs of the genres shared in common.

Example: =pair_genre_ic(dbr:'Metallica', dbr:'Megadeth', IC)=

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 band(Arg1)
 jaccard(Arg1, Arg2, Arg3)