Documentation
¶
Index ¶
- Constants
- func DbTriples2XML(refid string, context string, stripempty bool) ([]byte, error)
- func DeleteTriplesForRefId(refid string, context string) error
- func DeleteTriplesForRefIdAsync(deleteReq []byte, context string, outch chan<- *Triple, ...)
- func GetAllXMLByObject(object string, context string) ([]string, error)
- func Kla2staff(kla string, yrlvl string) []string
- func Kla2student(kla string, yrlvl string) []string
- func Kla2teachinggroup(kla string, yrlvl string) []string
- func Kla2timetablesubject(kla string, yrlvl string) []string
- func Map2SIFXML(m mxj.Map, stripempty bool) ([]byte, error)
- func Root2SIF(r string, j []byte) ([]byte, error)
- func SendTriplesAsync(triples []*Triple, context string, done chan<- struct{})
- func StoreJSONasDBtriplesAsync(s []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ...)
- func StoreXMLasDBtriplesAsync(s []byte, mustUseAdvisory bool, context string, outch chan<- *Triple, ...)
- func Tuples2JSON(triples []*Triple) (string, error)
- func UpdateFullXMLasDBtriples(object []byte, requested_refid string, context string) error
- func UpdateFullXMLasDBtriplesAsync(object []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ...)
- func UpdatePartialXMLasDBtriples(object []byte, requested_refid string, context string) error
- func UpdatePartialXMLasDBtriplesAsync(object []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ...)
- func XMLtoJSON(x []byte) ([]byte, error)
- type DeleteRequest
- type DeleteRequestElem
- type DeletesRequestElem
- type SifResponse
- type Triple
Constants ¶
const HTTPTHREADS = 100
max number of simultaneous http posts allowed
Variables ¶
This section is empty.
Functions ¶
func DbTriples2XML ¶
Retrieve the XML object corresponding to the tuples stored under the given RefId. Synchronous. If stripempty, strip empty tags from the XML object.
func DeleteTriplesForRefId ¶
Delete all triples with given refis as subject; synchronous
func DeleteTriplesForRefIdAsync ¶
func DeleteTriplesForRefIdAsync(deleteReq []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ch chan<- struct{})
processes deleteRequest object Delete all triples with their subject being one of the refids given in the SIF deleteRequest object deleteReq; asynchronous. Outputs SIF responses for each refid to errch Outputs a list of tuples to be sent to Hexastore to outch
func GetAllXMLByObject ¶
TODO: no flow control yet: may retrieve a massive number of RefIds Retrieve all RefIDs from Hexastore for the given object class. Synchronous
func Kla2staff ¶
NSW Digital Classroom hard coded query: retrieve staff teaching KLA (key learning area) in given year level
func Kla2student ¶
NSW Digital Classroom hard coded query: retrieve students studying KLA (key learning area) in given year level
func Kla2teachinggroup ¶
NSW Digital Classroom hard coded query: retrieve teaching groups about KLA (key learning area) in given year level
func Kla2timetablesubject ¶
NSW Digital Classroom hard coded query: retrieve timetable subjects about KLA (key learning area) in given year level
func Map2SIFXML ¶
Convert an MXJ map, as retrieved from tuples, into a byte encoding of a SIF XML object. If stripempty, make an effort to remove empty tags in the XML.
func SendTriplesAsync ¶
Send a slice of triples asynchronously to Nias3Engine
func StoreJSONasDBtriplesAsync ¶
func StoreJSONasDBtriplesAsync(s []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ch chan<- struct{})
Store a JSON object on the Hexastore. Asynchronous. Outputs SIF responses for each refid to errch Outputs a list of tuples to be sent to Hexastore to outch JSON object is assumed to have an "id" top-level value, which is the subject for the tuples of that object. If not present, one will be created. If it is present, and it has already been used as an object in that context, the request will be denied.
func StoreXMLasDBtriplesAsync ¶
func StoreXMLasDBtriplesAsync(s []byte, mustUseAdvisory bool, context string, outch chan<- *Triple, errch chan<- SifResponse, ch chan<- struct{})
Store an XML object on the Hexastore. If mustUseAdvisory is on, use the supplied RefId if available, else raise error; if off, generate new RefId. Asynchronous. Outputs SIF responses for each refid to errch Outputs a list of tuples to be sent to Hexastore to outch
func Tuples2JSON ¶
get tuples, and organise them into JSON objects by subject
func UpdateFullXMLasDBtriples ¶
Update an object, with Full Replacement on the Hexastore; synchronous Deletes all tuples for the refid from Hexastore, then creates tuples for the replacement object, and sends them to Hexastore as an ordered set of tuples
func UpdateFullXMLasDBtriplesAsync ¶
func UpdateFullXMLasDBtriplesAsync(object []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ch chan<- struct{})
Update an object, with Full Replacement on the Hexastore; asynchronous Deletes all tuples for the refid from Hexastore, then creates tuples for the replacement object, and sends them to Hexastore as an ordered set of tuples Outputs SIF responses for each refid to errch Outputs a list of tuples to be sent to Hexastore to outch
func UpdatePartialXMLasDBtriples ¶
Update an object, with Partial Replacement on the Hexastore; synchronous. Is a brute force patch; deletes then writes to all the subject-predicate instances it finds in the object. Does not otherwise delete anything, including extra list entries: e.g. if a list with two items is patched with a list of one item, it will overwrite the first item in the list, and will leave alone the second.
func UpdatePartialXMLasDBtriplesAsync ¶
func UpdatePartialXMLasDBtriplesAsync(object []byte, context string, outch chan<- *Triple, errch chan<- SifResponse, ch chan<- struct{})
Update an object, with Partial Replacement on the Hexastore; asynchronous. Is a brute force patch; deletes then writes to all the subject-predicate instances it finds in the object. Does not otherwise delete anything, including extra list entries: e.g. if a list with two items is patched with a list of one item, it will overwrite the first item in the list, and will leave alone the second. Outputs SIF responses for each refid to errch Outputs a list of tuples to be sent to Hexastore to outch
Types ¶
type DeleteRequest ¶
type DeleteRequest struct {
XMLName xml.Name `xml:"deleteRequest"`
DeletesRequestElem DeletesRequestElem `xml:"deletes"`
}
type DeleteRequestElem ¶
type DeleteRequestElem struct {
Id string `xml:"id,attr"`
}
type DeletesRequestElem ¶
type DeletesRequestElem struct {
Delete []DeleteRequestElem `xml:"delete"`
}
type SifResponse ¶
type SifResponse struct {
AdvisoryId string // The RefId in the request
RefId string // The RefId of the response object, which may be different
Error error
}
Response to CRUD action, to be posted back as SIF response for a payload with multiple records.
type Triple ¶
func StoreXMLasDBtriples ¶
func StoreXMLasDBtriples(object []byte, mustUseAdvisory bool, context string) (string, []*Triple, error)
Store the object on the Hexastore. If mustUseAdvisory is on, use the supplied RefId if available, else raise error; if off, generate new RefId. Synchronous. Return the RefId used, the triples to be posted, and the error.