Michele Pasin / Quotes

Term equality versus value equality in SPARQL

Now a lot of users of SPARQL probably don’t even know what I mean by the above, but I would give you good odds that most people are using the former without realizing it or knowing that the latter could actually be more performant in many scenarios.

So to illustrate this, let’s show you the difference in syntax. First, let’s see value equality:

FILTER(?x = 1)

And now let’s look at the corresponding term equality form:

FILTER(SAMETERM(?x, 1))

The syntactic difference is obvious –value equality uses the = operator while term equality uses the SAMETERM function. The latter is likely more performant but it does have a drawback in that it is only term equality. Term equality only returns true if the RDF terms are identical. So if the RDF term in the database was encoded as “001″^^xsd:integer term equality would give false whereas value equality would return true because the value of the terms is equivalent.

As a general rule, use term equality wherever the value of the term is not an issue, such as when you are matching URIs or non-value typed literals (e.g. plain literals, xsd:string, literals with language tags). Also if you know the RDF terms in your database are consistently encoded (or your database does this for you), then always use term equality unless value equality is more appropriate for your query.

Note that many SPARQL engines will be clever enough to turn value equality into term equality when possible, but not all will, so sometimes if you have a slow running query when using value equality, try switching to term equality and see if that improves things.

Saved 3 May 2013 / yarcdata.com ↗

#differences #database #most-people #values

The cool-person syndrome

The cool-person syndrome is peculiarly American. Part of that has to do with the way the educational business is run in the U. S. It’s not based on how much…

Zappa Quotes #children #persons #desire #things #most-people

Conspiracy theorists

Why does any of this matter? My concern is with the ultimate fate of knowing, of seeing the difference of what you can know and what you wish for. . . . The…

Why The Moon Landing Could Not Have Been A Hoax — It Wasn’t Technologically Possible To Fake It « The Scholarly Kitchen #differences #people #concern #fate

Definitive work

The final version of a work which has been published. Typically, the Definitive Work has been accepted, edited and published in print and/or digital form. The…

About Crossref #differences #records #DOI #version

Episodes and clips

Finally clips. Clips were a later addition to the PIPs model and describing them is hard. Importantly they are not (as the name might suggest) necessarily…

Designing A Url Structure For Bbc Programmes | Smethurst #episodes #series #program #differences

Exoticising the unfamiliar

However, there is clearly a danger here of exoticising the unfamiliar.

The Ego Trick (baggini, Julian) #culture #differences #perception

Loyal to the men, not the mafia

But I was alone, and for two reasons. The mafia was theirs, not mine. For them, the organisation always came first. But I was loyal to the men, not the mafia…

Shantaram (gregory David Roberts) #men #chest #differences #blood #women #mafia