Last active
October 6, 2016 20:53
-
-
Save jindrichmynarz/8fda968debb1d3a3873bcf3a41ba37c5 to your computer and use it in GitHub Desktop.
Fuse subset descriptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX : <http://example.com/> | |
DELETE { | |
?r1 ?outP ?outO . | |
?inS ?inP ?r1 . | |
} | |
INSERT { | |
?inS ?inP ?r2 . | |
} | |
WHERE { | |
{ | |
SELECT DISTINCT ?r1 ?r2 | |
WHERE { | |
# Select resources to fuse. | |
?r1 a :C . | |
?r2 a :C . | |
FILTER (!sameTerm(?r1, ?r2)) | |
# There's no property-value pair of ?r1 that ?r2 doesn't have. | |
FILTER NOT EXISTS { | |
?r1 ?p ?o . | |
FILTER NOT EXISTS { | |
?r2 ?p ?o . | |
} | |
} | |
} | |
} | |
?r1 ?outP ?outO . | |
OPTIONAL { | |
?inS ?inP ?r1 . | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment