Class RdfLiteralHash
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.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 Summary
Constructors Constructor Description RdfLiteralHash()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleandoesStmtMatchHash(DataPropertyStatement stmt, int hash)static DataPropertyStatementgetPropertyStmtByHash(String subjectUri, String predicateUri, int hash, org.apache.jena.rdf.model.Model model)Forward to either getDataPropertyStmtByHash or getRdfsLabelStatementByHash, depending on the property.static intmakeRdfLiteralHash(DataPropertyStatement stmt)Make a hash based on individual, property, literal and (lang or datatype).static intmakeRdfsLabelLiteralHash(Individual subject, String value, org.apache.jena.rdf.model.Model model)
-
-
-
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 statementhash- 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 URIpredicateUri- Predicate URIhash- Hashmodel- , 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)
-
-