tasks/rdfstore/index.js
function(ctx, term, usedCtx)
{
   var rval = term;
   
   // get JSON-LD keywords
   var keywords = _getKeywords(ctx);
   
   // 1. If the property has a colon, it is a prefix or an absolute IRI:
   var idx = term.indexOf(':');
   if(idx !== -1)
   {
      // get the potential prefix
      var prefix = term.substr(0, idx);

      // expand term if prefix is in context, otherwise leave it be
      if(prefix in ctx)
      {
         // prefix found, expand property to absolute IRI
         var iri = _getTermIri(ctx, prefix);
         rval = iri + term.substr(idx + 1);
         if(usedCtx !== null)
         {
            usedCtx[prefix] = _clone(ctx[prefix]);
         }
      }
   }
   // 2. If the property is in the context, then it's a term.
   else if(term in ctx)
   {
      rval = _getTermIri(ctx, term);
      if(usedCtx !== null)
      {
         usedCtx[term] = _clone(ctx[term]);
      }
   }
   // 3. The property is a keyword.
   else
   {
      for(var key in keywords)
      {
         if(term === keywords[key])
         {
            rval = key;
            break;
         }
      }
   }
   
   return rval;
}
function(ctx, term, usedCtx)
{
   var rval = term;
   
   // get JSON-LD keywords
   var keywords = _getKeywords(ctx);
   
   // 1. If the property has a colon, it is a prefix or an absolute IRI:
   var idx = term.indexOf(':');
   if(idx !== -1)
   {
      // get the potential prefix
      var prefix = term.substr(0, idx);

      // expand term if prefix is in context, otherwise leave it be
      if(prefix in ctx)
      {
         // prefix found, expand property to absolute IRI
         var iri = _getTermIri(ctx, prefix);
         rval = iri + term.substr(idx + 1);
         if(usedCtx !== null)
         {
            usedCtx[prefix] = _clone(ctx[prefix]);
         }
      }
   }
   // 2. If the property is in the context, then it's a term.
   else if(term in ctx)
   {
      rval = _getTermIri(ctx, term);
      if(usedCtx !== null)
      {
         usedCtx[term] = _clone(ctx[term]);
      }
   }
   // 3. The property is a keyword.
   else
   {
      for(var key in keywords)
      {
         if(term === keywords[key])
         {
            rval = key;
            break;
         }
      }
   }
   
   return rval;
}
function ( ctx , term , usedCtx ) { var rval = term ; // get JSON-LD keywords var keywords = _getKeywords ( ctx ) ; // 1. If the property has a colon, it is a prefix or an absolute IRI: var idx = term . indexOf ( ':' ) ; if ( idx !== - 1 ) { // get the potential prefix var prefix = term . substr ( 0 , idx ) ; // expand term if prefix is in context, otherwise leave it be if ( prefix in ctx ) { // prefix found, expand property to absolute IRI var iri = _getTermIri ( ctx , prefix ) ; rval = iri + term . substr ( idx + 1 ) ; if ( usedCtx !== null ) { usedCtx [ prefix ] = _clone ( ctx [ prefix ] ) ; } } } // 2. If the property is in the context, then it's a term. else if ( term in ctx ) { rval = _getTermIri ( ctx , term ) ; if ( usedCtx !== null ) { usedCtx [ term ] = _clone ( ctx [ term ] ) ; } } // 3. The property is a keyword. else { for ( var key in keywords ) { if ( term === keywords [ key ] ) { rval = key ; break ; } } } return rval ; }
Expands a term into an absolute IRI. The term may be a regular term, a
prefix, a relative IRI, or an absolute IRI. In any case, the associated
absolute IRI will be returned.

@param ctx the context to use.
@param term the term to expand.
@param usedCtx a context to update if a value was used from "ctx".

@return the expanded term as an absolute IRI.
Expands a term into an absolute IRI . The term may be a regular term a prefix a relative IRI or an absolute IRI . In any case the associated absolute IRI will be returned .