rdfframework package

Submodules

rdfframework.framework module

class rdfframework.framework.RdfFramework[source]

Bases: object

base class for Knowledge Links’ Graph database RDF vocabulary framework

api_exists(api_path)[source]

Tests to see if the form and instance is valid

apis_initialized = False
app_initialized = False
class_initialized = False
form_exists(form_path)[source]

Tests to see if the form and instance is valid

forms_initialized = False
get_api_name(api_uri)[source]

returns the API name for an API

get_api_path(api_uri, instance)[source]

reads through the list of defined forms and returns the path

get_form_name(form_uri)[source]

returns the form name for a form

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.framework.verify_server_core(timeout=120, start_delay=90)[source]

checks to see if the server_core is running

args:
delay: will cycle till core is up. timeout: number of seconds to wait

rdfframework.getframework module

rdfframework.getframework.get_framework(**kwargs)[source]

sets an instance of the the framework as a global variable. This this method is then called to access that specific instance

rdfframework.rdfclass module

class rdfframework.rdfclass.RdfClass(json_obj, class_name, **kwargs)[source]

Bases: object

RDF 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

list_properties()[source]

Returns a set of the properties used for the class

list_required()[source]

Returns a set of the required properties for the class

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)
uri_patterner(uid, **kwargs)[source]
validate_obj_data(rdf_obj, old_data)[source]

This method will validate whether the supplied object data meets the class requirements and returns the results

validate_primary_key(rdf_obj, old_data)[source]

query to see if PrimaryKey is Valid

rdfframework.rdfdatatype module

class rdfframework.rdfdatatype.RdfDataType(rdf_data_type=None, **kwargs)[source]

Bases: object

This class will generate a rdf data type

sparql(data_value)[source]

formats a value for a sparql triple

rdfframework.rdfproperty module

class rdfframework.rdfproperty.RdfProperty(prop_list, data=None, subject_uri=None)[source]

Bases: object

Module contents