rdf-database.js
/**
   Perform a SPARQL get on a describe query minted to reflect the state of the given key object.
   @param {Object} keyObject
   @param {Object} options
   @param {(function|null)} [continuation]
   */
Perform a SPARQL get on a describe query minted to reflect the state of the given key object.
Perform a SPARQL get on a describe query minted to reflect the state of the given key object .
describe(keyObject, options, continuation) {
    console.log("RDFDatabase.describe");
    console.log(keyObject);
    options = Object.assign({}, options,
                    {"Accept": 'application/n-quads',
                     environment: this.environment,
                     authentication: this.authentication});
    var thisDatabase = this;
    var properties = keyObject.persistentProperties();
    var where = Object.getOwnPropertyNames(keyObject).map(function(key) {
      if (properties.indexOf(key) >= 0) {
        var value = keyObject[key];
        if (value) {
          var predicate = thisDatabase.environment.createNamedNode(key);
          return (`?s <${predicate.lexicalForm}> "${value}" .`);
        } else {
          return ("");
        }
      } else {
       return ("");
      }
    }).join(' ');
    var query = `describe ?s where { ${where} }`;
    postResource(thisDatabase.location, query, options, continuation );
  }
describe ( keyObject , options , continuation ) { console . log ( "RDFDatabase.describe" ) ; console . log ( keyObject ) ; options = Object . assign ( { } , options , { "Accept" : 'application/n-quads' , environment : this . environment , authentication : this . authentication } ) ; var thisDatabase = this ; var properties = keyObject . persistentProperties ( ) ; var where = Object . getOwnPropertyNames ( keyObject ) . map ( function ( key ) { if ( properties . indexOf ( key ) >= 0 ) { var value = keyObject [ key ] ; if ( value ) { var predicate = thisDatabase . environment . createNamedNode ( key ) ; return ( ` ${ predicate . lexicalForm } ${ value } ` ) ; } else { return ( "" ) ; } } else { return ( "" ) ; } } ) . join ( ' ' ) ; var query = ` ${ where } ` ; postResource ( thisDatabase . location , query , options , continuation ) ; }
Perform a SPARQL get on a describe query minted to reflect the state of the given key object.
Perform a SPARQL get on a describe query minted to reflect the state of the given key object .
// console.log('predicate ' + key + ' : ' + predicate)