rdfframework package¶
Subpackages¶
Submodules¶
rdfframework.framework module¶
-
class
rdfframework.framework.RdfFramework[source]¶ Bases:
objectbase class for Knowledge Links’ Graph database RDF vocabulary framework
-
apis_initialized= False¶
-
app_initialized= False¶
-
class_initialized= False¶
-
forms_initialized= False¶
-
get_api_path(api_uri, instance)[source]¶ reads through the list of defined forms and returns the path
-
get_form_path(form_uri, instance)[source]¶ reads through the list of defined APIs and returns the path
-
get_obj_data(rdf_obj, **kwargs)[source]¶ returns the data for the current form paramters **keyword arguments subject_uri: the URI for the subject class_uri: the rdf class of the subject
-
get_prefix(format_type='sparql')[source]¶ Generates a string of the rdf namespaces listed used in the framework
formatType: “sparql” or “turtle”
-
load_default_data()[source]¶ reads default data in the fw_config and attempts to add it to the server core i.e. inital users and organizations
-
rdf_app_dict= {}¶
-
rdf_class_dict= {}¶
-
rdf_form_dict= {}¶
-
save_obj(rdf_obj, old_data=None)[source]¶ Recieves RDF_formfactory form, validates and saves the data
* Steps * - determine if subform is present - group fields by class - validate the form data for class requirements - determine the class save order. classes with no dependant properties
saved first- send data to classes for processing
- send data to classes for saving
-
save_object_with_subobj(rdf_obj, old_data=None)[source]¶ finds the subform field and appends the parent form attributes to the subform entries and individually sends the augmented subform to the main save_form property
-
user_authentication(rdf_obj)[source]¶ reads the object for authentication information and sets the flask userclass information
-
value_processors= []¶
-
rdfframework.getframework module¶
rdfframework.rdfclass module¶
-
class
rdfframework.rdfclass.RdfClass(json_obj, class_name, **kwargs)[source]¶ Bases:
objectRDF Class for an RDF Class object. Used for manipulating and validating an RDF Class subject
-
get_property(prop_uri)[source]¶ Method returns the property json object
- keyword Args:
- prop_name: The Name of the property prop_uri: The URI of the property ** the PropName or URI is required
-
list_dependant()[source]¶ Returns a set of properties that are dependent upon the creation of another object
-
new_uri()[source]¶ * to be written * generates a new URI
– for fedora generates the container and returns the URI – for blazegraph process will need to be created
-
save(rdf_obj, validation_status=True)[source]¶ Method validates and saves passed data for the class
- Args:
- rdf_obj – Current RDF Form class fields validationS
- valid_required_props = self._validate_required_properties(
- rdf_obj, old_form_data)
- validDependancies = self._validate_dependant_props(
- rdf_obj, old_form_data)
-