Class RdfLiteralHash


  • public class RdfLiteralHash
    extends Object
    Set of static methods to create hashes for RDF literal statements so they can be referenced in HTTP parameters. This allows the creation of a URL to request the deletion of a RDF literal statement without including the whole literal in the parameters. ex. http://fake.com/delete?sub="http://bob"&pred="http://hasNickName"&stmtHash="23443434" This could request the deletion of a the statement for Bob's nickname where the literal matched the hash 23443434. The hash is for the whole statement, not just the literal part. The has will only match if the subject, predicate, datetype/language and literal match.
    • Constructor Detail

      • RdfLiteralHash

        public RdfLiteralHash()
    • Method Detail

      • makeRdfLiteralHash

        public static int makeRdfLiteralHash​(DataPropertyStatement stmt)
        Make a hash based on individual, property, literal and (lang or datatype).
        Parameters:
        stmt - Data statement
        Returns:
        a value between MIN_INTEGER and MAX_INTEGER
      • doesStmtMatchHash

        public static boolean doesStmtMatchHash​(DataPropertyStatement stmt,
                                                int hash)
        Parameters:
        stmt - Data statement
        hash - Hash
      • getPropertyStmtByHash

        public static DataPropertyStatement getPropertyStmtByHash​(String subjectUri,
                                                                  String predicateUri,
                                                                  int hash,
                                                                  org.apache.jena.rdf.model.Model model)
        Forward to either getDataPropertyStmtByHash or getRdfsLabelStatementByHash, depending on the property.
        Parameters:
        subjectUri - Subject URI
        predicateUri - Predicate URI
        hash - Hash
        model - , may not be null
        Returns:
        a DataPropertyStatement if found or null if not found
      • makeRdfsLabelLiteralHash

        public static int makeRdfsLabelLiteralHash​(Individual subject,
                                                   String value,
                                                   org.apache.jena.rdf.model.Model model)