Class JenaBaseDao
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.dao.jena.JenaBaseDaoCon
-
- edu.cornell.mannlib.vitro.webapp.dao.jena.JenaBaseDao
-
- Direct Known Subclasses:
ApplicationDaoJena,DataPropertyStatementDaoJena,DatatypeDaoJena,FauxPropertyDaoJena,IndividualDaoJena,MenuDaoJena,ObjectPropertyStatementDaoJena,OntologyDaoJena,PageDaoJena,PropertyDaoJena,PropertyGroupDaoJena,UserAccountsDaoJena,VClassDaoJena,VClassGroupDaoJena
public class JenaBaseDao extends JenaBaseDaoCon
-
-
Field Summary
Fields Modifier and Type Field Description protected StringDEFAULT_NAMESPACEstatic booleanKEEP_ONLY_IF_FALSEstatic booleanKEEP_ONLY_IF_TRUEprotected static org.apache.commons.logging.Loglogprotected Set<String>NONUSER_NAMESPACESprotected List<String>PREFERRED_LANGUAGESprotected StringPSEUDO_BNODE_NSprotected StringXSDprotected DateFormatxsdDateFormatprotected DateFormatxsdDateTimeFormat-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.dao.jena.JenaBaseDaoCon
ADDITIONAL_LINK, APPLICATION_ABOUTTEXT, APPLICATION_ACKNOWLEGETEXT, APPLICATION_CONTACTMAIL, APPLICATION_COPYRIGHTANCHOR, APPLICATION_COPYRIGHTURL, APPLICATION_CORRECTIONMAIL, APPLICATION_THEMEDIR, CLASSGROUP, DATAPROPERTY_ISEXTERNALID, DESCRIPTION_ANNOT, DISPLAY_LIMIT, DISPLAY_RANK, DISPLAY_RANK_ANNOT, EDITING, EXAMPLE, EXAMPLE_ANNOT, HIDDEN_FROM_DISPLAY_BELOW_ROLE_LEVEL_ANNOT, HIDDEN_FROM_PUBLISH_BELOW_ROLE_LEVEL_ANNOT, IN_CLASSGROUP, IND_MAIN_IMAGE, LINK, LINK_ANCHOR, LINK_DISPLAYRANK, LINK_TYPE, LINK_URL, MODTIME, MONIKER, ONTOLOGY_PREFIX_ANNOT, PERMISSION, PERMISSION_SET_FOR_NEW_USERS, PERMISSION_SET_FOR_PUBLIC, PERMISSIONSET, PERMISSIONSET_HAS_PERMISSION, PORTAL, PRIMARY_LINK, PROHIBITED_FROM_UPDATE_BELOW_ROLE_LEVEL_ANNOT, PROPERTY_ADDLINKSUPPRESSED, PROPERTY_COLLATEBYSUBCLASSANNOT, PROPERTY_CUSTOM_LIST_VIEW_ANNOT, PROPERTY_CUSTOMDISPLAYVIEWANNOT, PROPERTY_CUSTOMENTRYFORMANNOT, PROPERTY_CUSTOMSEARCHVIEWANNOT, PROPERTY_CUSTOMSHORTVIEWANNOT, PROPERTY_DELETELINKSUPPRESSED, PROPERTY_EDITLINKSUPPRESSED, PROPERTY_ENTITYSORTDIRECTION, PROPERTY_ENTITYSORTFIELD, PROPERTY_FULLPROPERTYNAMEANNOT, PROPERTY_INPROPERTYGROUPANNOT, PROPERTY_OBJECTINDIVIDUALSORTPROPERTY, PROPERTY_OFFERCREATENEWOPTIONANNOT, PROPERTY_SELECTFROMEXISTINGANNOT, PROPERTY_STUBOBJECTPROPERTYANNOT, PROPERTYGROUP, PUBLIC_DESCRIPTION_ANNOT, SEARCH_BOOST_ANNOT, SHORTDEF, USERACCOUNT, USERACCOUNT_ARGON2_PASSWORD, USERACCOUNT_EMAIL_ADDRESS, USERACCOUNT_EMAIL_KEY, USERACCOUNT_EXTERNAL_AUTH_ID, USERACCOUNT_EXTERNAL_AUTH_ONLY, USERACCOUNT_FIRST_NAME, USERACCOUNT_HAS_PERMISSION_SET, USERACCOUNT_LAST_LOGIN_TIME, USERACCOUNT_LAST_NAME, USERACCOUNT_LOGIN_COUNT, USERACCOUNT_MD5_PASSWORD, USERACCOUNT_OLD_PASSWORD, USERACCOUNT_PASSWORD_CHANGE_REQUIRED, USERACCOUNT_PASSWORD_LINK_EXPIRES, USERACCOUNT_PROXY_EDITOR_FOR, USERACCOUNT_ROOT_USER, USERACCOUNT_STATUS, VITRO_PUBLIC_ONTOLOGY
-
-
Constructor Summary
Constructors Constructor Description JenaBaseDao(WebappDaoFactoryJena wadf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPropertyBooleanValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, Boolean value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyDateTimeValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyDateValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.DatatypeProperty dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyFloatValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Float value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyLongValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, long value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyNonNegativeIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience methodprotected voidaddPropertyResourceURIValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.ObjectProperty prop, String objectURI)convenience method for use with functional object propertiesprotected voidaddPropertyResourceValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, org.apache.jena.rdf.model.Resource objectRes)convenience method for use with functional object propertiesprotected voidaddPropertyStringValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, String value, org.apache.jena.rdf.model.Model model)convenience methodprotected StringcheckURI(String uri)Checks a URI for validity.protected StringgetClassURIStr(org.apache.jena.rdf.model.Resource cls)protected StringgetDefaultLanguage()protected StringgetLabel(org.apache.jena.ontology.OntResource r)protected org.apache.jena.rdf.model.LiteralgetLabelLiteral(String individualUri)protected org.apache.jena.rdf.model.LiteralgetLabelLiteral(org.apache.jena.ontology.OntResource r)works through list of PREFERRED_LANGUAGES to find an appropriate label, or NULL if not found.protected StringgetLabelOrId(org.apache.jena.ontology.OntResource r)Get the rdfs:label or vitro:label, working through PERFERED_LANGUAGES, or get local name, bnode Id, or full URI if no labels found.protected StringgetLocalNameOrId(org.apache.jena.ontology.OntResource r)Get the local name, bnode or URI of the resource.protected BaseResourceBean.RoleLevelgetMostRestrictiveRoleLevel(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop)protected org.apache.jena.ontology.OntClassgetOntClass(org.apache.jena.ontology.OntModel ontModel, String vitroURIStr)protected org.apache.jena.ontology.OntModelgetOntModel()protected OntModelSelectorgetOntModelSelector()protected BooleangetPropertyBooleanValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected DategetPropertyDateTimeValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected DategetPropertyDateValue(org.apache.jena.ontology.OntResource res, org.apache.jena.ontology.DatatypeProperty dataprop)convenience methodprotected FloatgetPropertyFloatValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property prop)protected intgetPropertyIntValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected longgetPropertyLongValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected IntegergetPropertyNonNegativeIntegerValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected intgetPropertyNonNegativeIntValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected Collection<String>getPropertyResourceURIValues(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.ObjectProperty prop)convenience method for use with functional object propertiesprotected StringgetPropertyStringValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience methodprotected org.apache.jena.rdf.model.Model[]getSmartRemoval(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.ontology.OntModel ontModel)Returns additions and retractions to performprotected WebappDaoFactoryJenagetWebappDaoFactory()protected List<org.apache.jena.ontology.OntModel>getWritableOntModelList()booleanisBooleanClassExpression(org.apache.jena.ontology.OntClass cls)protected List<org.apache.jena.rdf.model.Resource>listDirectObjectPropertySubjects(org.apache.jena.rdf.model.Resource value, org.apache.jena.rdf.model.Property prop)protected List<org.apache.jena.rdf.model.Resource>listDirectObjectPropertyValues(org.apache.jena.rdf.model.Resource subj, org.apache.jena.rdf.model.Property prop)protected org.apache.jena.graph.NodemakeNodeForURI(String vitroURIStr)voidremoveRulesMentioningResource(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.OntModel ontModel)protected voidsmartRemove(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.ontology.OntModel ontModel)protected org.apache.jena.rdf.model.LiteraltryLiteralForPreferredLanguages(List<org.apache.jena.rdf.model.Literal> labels)Searches for literal in preferred language.protected voidupdatePlainLiteralValue(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.rdf.model.Property property, String lexicalForm)Add to an OntResource a Property value with lexical form and default language tag.protected voidupdatePlainLiteralValue(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.rdf.model.Property property, String lexicalForm, String lang)Add to an OntResource a Property value with lexical form and optional language tag.protected voidupdatePropertyBooleanValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Boolean value, org.apache.jena.rdf.model.Model model, boolean keepOnlyIfTrue)Convenience method for use with functional datatype properties.protected voidupdatePropertyDateTimeValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdatePropertyDateValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.DatatypeProperty dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdatePropertyFloatValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Float value, org.apache.jena.rdf.model.Model model)convenience method for use with functional propertiesprotected voidupdatePropertyIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdatePropertyLongValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Long value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdatePropertyNonNegativeIntegerValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Integer value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdatePropertyNonNegativeIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdatePropertyResourceURIValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, String objectURI)convenience method for use with functional propertiesprotected voidupdatePropertyResourceURIValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, String uri, org.apache.jena.rdf.model.Model model)convenience method for use with functional propertiesprotected voidupdatePropertyResourceURIValues(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, Collection<String> uris, org.apache.jena.rdf.model.Model model)convenience method to update the value(s) of a one-to-many object property NOTE: this should be run from within a CriticalSection(WRITE)protected voidupdatePropertyResourceValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, org.apache.jena.rdf.model.Resource objectRes)convenience method for use with functional propertiesprotected voidupdatePropertyResourceValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, org.apache.jena.rdf.model.Resource objectRes, org.apache.jena.rdf.model.Model model)convenience method for use with functional propertiesprotected voidupdatePropertyStringValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, String value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype propertiesprotected voidupdateRDFSLabel(org.apache.jena.ontology.OntResource ontRes, String lexicalForm)Add to an OntResource an rdfs:label value with lexical form and default language tag.protected voidupdateRDFSLabel(org.apache.jena.ontology.OntResource ontRes, String lexicalForm, String lang)Add to an OntResource an rdfs:label value with lexical form and optional language tag.-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.dao.jena.JenaBaseDaoCon
getConstModel
-
-
-
-
Field Detail
-
KEEP_ONLY_IF_TRUE
public static final boolean KEEP_ONLY_IF_TRUE
- See Also:
- Constant Field Values
-
KEEP_ONLY_IF_FALSE
public static final boolean KEEP_ONLY_IF_FALSE
- See Also:
- Constant Field Values
-
log
protected static final org.apache.commons.logging.Log log
-
PSEUDO_BNODE_NS
protected String PSEUDO_BNODE_NS
-
XSD
protected String XSD
-
xsdDateFormat
protected DateFormat xsdDateFormat
-
xsdDateTimeFormat
protected DateFormat xsdDateTimeFormat
-
DEFAULT_NAMESPACE
protected String DEFAULT_NAMESPACE
-
-
Constructor Detail
-
JenaBaseDao
public JenaBaseDao(WebappDaoFactoryJena wadf)
-
-
Method Detail
-
getOntModel
protected org.apache.jena.ontology.OntModel getOntModel()
-
getOntModelSelector
protected OntModelSelector getOntModelSelector()
-
getWritableOntModelList
protected List<org.apache.jena.ontology.OntModel> getWritableOntModelList()
-
getWebappDaoFactory
protected WebappDaoFactoryJena getWebappDaoFactory()
-
getPropertyStringValue
protected String getPropertyStringValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)
convenience method
-
addPropertyStringValue
protected void addPropertyStringValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, String value, org.apache.jena.rdf.model.Model model)convenience method
-
getPropertyBooleanValue
protected Boolean getPropertyBooleanValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)
convenience method
-
addPropertyBooleanValue
protected void addPropertyBooleanValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, Boolean value, org.apache.jena.rdf.model.Model model)convenience method
-
updatePropertyStringValue
protected void updatePropertyStringValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, String value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
updatePropertyBooleanValue
protected void updatePropertyBooleanValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Boolean value, org.apache.jena.rdf.model.Model model, boolean keepOnlyIfTrue)Convenience method for use with functional datatype properties. Pass keepOnlyIfTrue if a lack of a value in the model indicates false. See ObjectPropertyDaoJena and PROPERTY_OFFERCREATENEWOPTIONANNOT for an example.
-
getPropertyNonNegativeIntValue
protected int getPropertyNonNegativeIntValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience method
-
getPropertyNonNegativeIntegerValue
protected Integer getPropertyNonNegativeIntegerValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)
convenience method
-
addPropertyIntValue
protected void addPropertyIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience method
-
addPropertyLongValue
protected void addPropertyLongValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, long value, org.apache.jena.rdf.model.Model model)convenience method
-
updatePropertyIntValue
protected void updatePropertyIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
getPropertyIntValue
protected int getPropertyIntValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience method
-
addPropertyNonNegativeIntValue
protected void addPropertyNonNegativeIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience method
-
updatePropertyNonNegativeIntValue
protected void updatePropertyNonNegativeIntValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, int value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
updatePropertyNonNegativeIntegerValue
protected void updatePropertyNonNegativeIntegerValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Integer value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
updatePropertyLongValue
protected void updatePropertyLongValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Long value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
getPropertyLongValue
protected long getPropertyLongValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)convenience method
-
addPropertyFloatValue
protected void addPropertyFloatValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Float value, org.apache.jena.rdf.model.Model model)convenience method
-
updatePropertyFloatValue
protected void updatePropertyFloatValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Float value, org.apache.jena.rdf.model.Model model)convenience method for use with functional properties
-
getPropertyFloatValue
protected Float getPropertyFloatValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property prop)
-
getPropertyDateValue
protected Date getPropertyDateValue(org.apache.jena.ontology.OntResource res, org.apache.jena.ontology.DatatypeProperty dataprop)
convenience method
-
addPropertyDateValue
protected void addPropertyDateValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.DatatypeProperty dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience method- Parameters:
res- Resourcedataprop- Datatype propertyvalue- Datemodel- Jena Model
-
updatePropertyDateValue
protected void updatePropertyDateValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.DatatypeProperty dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
getPropertyDateTimeValue
protected Date getPropertyDateTimeValue(org.apache.jena.ontology.OntResource res, org.apache.jena.rdf.model.Property dataprop)
convenience method
-
addPropertyDateTimeValue
protected void addPropertyDateTimeValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience method
-
updatePropertyDateTimeValue
protected void updatePropertyDateTimeValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property dataprop, Date value, org.apache.jena.rdf.model.Model model)convenience method for use with functional datatype properties
-
getPropertyResourceURIValues
protected Collection<String> getPropertyResourceURIValues(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.ObjectProperty prop)
convenience method for use with functional object properties
-
getMostRestrictiveRoleLevel
protected BaseResourceBean.RoleLevel getMostRestrictiveRoleLevel(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop)
-
addPropertyResourceURIValue
protected void addPropertyResourceURIValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.ObjectProperty prop, String objectURI)convenience method for use with functional object properties
-
updatePropertyResourceURIValue
protected void updatePropertyResourceURIValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, String objectURI)convenience method for use with functional properties
-
updatePropertyResourceURIValue
protected void updatePropertyResourceURIValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, String uri, org.apache.jena.rdf.model.Model model)convenience method for use with functional properties
-
addPropertyResourceValue
protected void addPropertyResourceValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, org.apache.jena.rdf.model.Resource objectRes)convenience method for use with functional object properties
-
updatePropertyResourceValue
protected void updatePropertyResourceValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, org.apache.jena.rdf.model.Resource objectRes)convenience method for use with functional properties
-
updatePropertyResourceValue
protected void updatePropertyResourceValue(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, org.apache.jena.rdf.model.Resource objectRes, org.apache.jena.rdf.model.Model model)convenience method for use with functional properties
-
updatePropertyResourceURIValues
protected void updatePropertyResourceURIValues(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Property prop, Collection<String> uris, org.apache.jena.rdf.model.Model model)convenience method to update the value(s) of a one-to-many object property NOTE: this should be run from within a CriticalSection(WRITE)
-
updateRDFSLabel
protected void updateRDFSLabel(org.apache.jena.ontology.OntResource ontRes, String lexicalForm)Add to an OntResource an rdfs:label value with lexical form and default language tag. Remove any other existing values in default language. If lexicalForm parameter is null, remove all plain literal values of Property in default language.- Parameters:
ontRes- may not be nulllexicalForm- may be null. If null, existing values will be deleted but none will be added.
-
updateRDFSLabel
protected void updateRDFSLabel(org.apache.jena.ontology.OntResource ontRes, String lexicalForm, String lang)Add to an OntResource an rdfs:label value with lexical form and optional language tag. Remove any other existing plain literal values that match specified language or lack language tags if no language is supplied. If lexicalForm parameter is null, remove all plain literal labels in specified language, or all existing language-less labels if no language is specified.- Parameters:
ontRes- may not be nulllexicalForm- may be null. If null, existing values will be deleted but none will be added.lang- may be null. If null, method acts on language-less plain literal labels and ignores those with language tags.
-
updatePlainLiteralValue
protected void updatePlainLiteralValue(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.rdf.model.Property property, String lexicalForm)Add to an OntResource a Property value with lexical form and default language tag. Remove any other existing values in default language. If lexicalForm parameter is null, remove all plain literal values of Property in default language.- Parameters:
ontRes- may not be nulllexicalForm- may be null. If null, existing values will be deleted but none will be added.
-
updatePlainLiteralValue
protected void updatePlainLiteralValue(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.rdf.model.Property property, String lexicalForm, String lang)Add to an OntResource a Property value with lexical form and optional language tag. Remove any other existing plain literal values that match specified language or lack language tags if no language is supplied. If lexicalForm parameter is null, remove all plain literal values of Property in specified language, or all existing language-less literals if no language is specified.- Parameters:
ontRes- may not be nulllexicalForm- may be null. If null, existing values will be deleted but none will be added.lang- may be null. If null, method acts on language-less plain literal values and ignores those with language tags.
-
getLabelOrId
protected String getLabelOrId(org.apache.jena.ontology.OntResource r)
Get the rdfs:label or vitro:label, working through PERFERED_LANGUAGES, or get local name, bnode Id, or full URI if no labels found.
-
getLabel
protected String getLabel(org.apache.jena.ontology.OntResource r)
-
getLabelLiteral
protected org.apache.jena.rdf.model.Literal getLabelLiteral(String individualUri)
-
getLabelLiteral
protected org.apache.jena.rdf.model.Literal getLabelLiteral(org.apache.jena.ontology.OntResource r)
works through list of PREFERRED_LANGUAGES to find an appropriate label, or NULL if not found.
-
getLocalNameOrId
protected String getLocalNameOrId(org.apache.jena.ontology.OntResource r)
Get the local name, bnode or URI of the resource.
-
tryLiteralForPreferredLanguages
protected org.apache.jena.rdf.model.Literal tryLiteralForPreferredLanguages(List<org.apache.jena.rdf.model.Literal> labels)
Searches for literal in preferred language.- Parameters:
labels- the literals to search; must not be null- Returns:
- the literal in preferred language if its containing in given list; otherwise the first entry will returned; returns null if an empty list was given
-
getDefaultLanguage
protected String getDefaultLanguage()
-
checkURI
protected String checkURI(String uri)
Checks a URI for validity. Jena models can store invalid URIs, but this causes RDF/XML output serialization to fail.- Parameters:
uri- URI- Returns:
- null if URI is good, otherwise an error message String
-
isBooleanClassExpression
public boolean isBooleanClassExpression(org.apache.jena.ontology.OntClass cls)
-
getOntClass
protected org.apache.jena.ontology.OntClass getOntClass(org.apache.jena.ontology.OntModel ontModel, String vitroURIStr)
-
getClassURIStr
protected String getClassURIStr(org.apache.jena.rdf.model.Resource cls)
-
makeNodeForURI
protected org.apache.jena.graph.Node makeNodeForURI(String vitroURIStr)
-
listDirectObjectPropertyValues
protected List<org.apache.jena.rdf.model.Resource> listDirectObjectPropertyValues(org.apache.jena.rdf.model.Resource subj, org.apache.jena.rdf.model.Property prop)
-
listDirectObjectPropertySubjects
protected List<org.apache.jena.rdf.model.Resource> listDirectObjectPropertySubjects(org.apache.jena.rdf.model.Resource value, org.apache.jena.rdf.model.Property prop)
-
getSmartRemoval
protected org.apache.jena.rdf.model.Model[] getSmartRemoval(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.ontology.OntModel ontModel)Returns additions and retractions to perform- Parameters:
ontRes- Ontology resourceontModel- Ontology model- Returns:
- Model[] where [0] is retractions and [1] is additions
-
smartRemove
protected void smartRemove(org.apache.jena.ontology.OntResource ontRes, org.apache.jena.ontology.OntModel ontModel)
-
removeRulesMentioningResource
public void removeRulesMentioningResource(org.apache.jena.rdf.model.Resource res, org.apache.jena.ontology.OntModel ontModel)
-
-