@since 0.1

@param string $oclcID
@param array $jsonld
180092
public function doProcess( $oclcID, array $jsonld ) {
		foreach ( $jsonld as $graph ) {
			$this->doProcessGraphElementsFor( $oclcID, $graph );
		}
	}
1169736
protected function updateNode(
        $jsonld_url,
        $fedora_url,
        $token = null
    ) {
        // Get the RDF from Fedora.
        $headers = empty($token) ? [] : ['Authorization' => $token];
        $headers['Accept'] = 'application/ld+json';
        $fedora_response = $this->fedora->getResource(
            $fedora_url,
            $headers
        );

        $status = $fedora_response->getStatusCode();
        if ($status != 200) {
            $reason = $fedora_response->getReasonPhrase();
            throw new \RuntimeException(
                "Client error: `GET $fedora_url` resulted in a `$status $reason` response: " .
                    $fedora_response->getBody(),
                $status
            );
        }

        // Strip off the W/ prefix to make the ETag strong.
        $etags = $fedora_response->getHeader("ETag");
        $etag = ltrim(reset($etags), "W/");

        // Get the modified date from the RDF.
        $fedora_jsonld = json_decode(
            $fedora_response->getBody(),
            true
        );

        // Account for the fact that new media haven't got a modified date
        // pushed to it from Drupal yet.
        try {
            $fedora_modified = $this->getModifiedTimestamp(
                $fedora_jsonld
            );
        } catch (\RuntimeException $e) {
            $fedora_modified = 0;
        }

        // Get the jsonld from Drupal.
        $headers = empty($token) ? [] : ['Authorization' => $token];
        $drupal_response = $this->drupal->get(
            $jsonld_url,
            ['headers' => $headers]
        );
        $drupal_jsonld = json_decode(
            $drupal_response->getBody(),
            true
        );

        // Mash it into the shape Fedora accepts.
        $drupal_jsonld = $this->processJsonld(
            $drupal_jsonld,
            $jsonld_url,
            $fedora_url
        );

        // Get the modified date from the RDF.
        $drupal_modified = $this->getModifiedTimestamp(
            $drupal_jsonld
        );

        // Abort with 412 if the Drupal RDF is stale.
        if ($drupal_modified <= $fedora_modified) {
            throw new \RuntimeException(
                "Not updating $fedora_url because RDF at $jsonld_url is not newer",
                412
            );
        }

        // Conditionally save it in Fedora.
        $headers['Content-Type'] = 'application/ld+json';
        $headers['Prefer'] = 'return=minimal; handling=lenient';
        $headers['If-Match'] = $etag;
        $response = $this->fedora->saveResource(
            $fedora_url,
            json_encode($drupal_jsonld),
            $headers
        );

        $status = $response->getStatusCode();
        if (!in_array($status, [201, 204])) {
            $reason = $response->getReasonPhrase();
            throw new \RuntimeException(
                "Client error: `PUT $fedora_url` resulted in a `$status $reason` response: " . $response->getBody(),
                $status
            );
        }

        // Return the response from Fedora.
        return $response;
    }
90071
def transform_jsonld(self, obj):
        """"""
        rec = copy.deepcopy(obj)
        rec.update(self.context)
        compacted = jsonld.compact(rec, self.context)
        if not self.expanded:
            return compacted
        else:
            return jsonld.expand(compacted)[0]
1235226
public static JsonArrayDocument create(String id, JsonArray content) {
        return new JsonArrayDocument(id, 0, content, 0, null);
    }
989949
public function putFieldAcl($id, array $rights, $guestSpaceId = null, $revision = -1): array
    {
        $options = ['json' => compact('id', 'rights', 'revision')];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->put(KintoneApi::generateUrl('preview/field/acl.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
748171
function prepareEPUBDataForIndexing(metaData, data) {
    if(!metaData.spineItems.length) {
        return;
    }

    if (!data.FirstSpineItemsId) {
        data.FirstSpineItemsId = [];
    }

    data.FirstSpineItemsId.push(
        metaData.spineItems[0].id + ':' + metaData.title
    );

    metaData.spineItems.forEach( spineItem => {
        const spineItemPath = metaData.manifestPath + '/' + spineItem.href;
        const json = htmlToJSON(spineItemPath);
        setMetaData(json, metaData, spineItem);
        data.push(json);
    });
}
1057659
public function updateObject($entity, $_id, $jsonObject)
	{
		$retValue = true;

		try{
			$query = array('_id' => new MongoId($_id));
			$jsonUpd = array('$set' => $jsonObject);

			if (! is_null($this->_db)){
				$mongo = $this->_db->selectCollection($entity);

			    // Update Object
			    $result = $mongo->update($query, $jsonUpd, array('w' => 1));

			    $retValue = $result["updatedExisting"];
			}
		}
		catch (Exception $e) {
			$this->_log->addError($e->getMessage());
		    $retValue = false;
		}

		return $retValue;
	}
1025740
@Override
	public void setJsonDirOrFile(String jsonDirOrFile) {
		File file = new File(jsonDirOrFile);
		if (file.isDirectory()) configuration.setProcessConfigDir(file);
		else configuration.setProcessConfigFile(file);
	}
1032239
private function validateJsonRpcMethodDefinition(string $serviceId, Definition $definition) : void
    {
        if (!in_array(JsonRpcMethodInterface::class, class_implements($definition->getClass()))) {
            throw new LogicException(sprintf(
                'Service "%s" is taggued as JSON-RPC method but does not implement %s',
                $serviceId,
                JsonRpcMethodInterface::class
            ));
        }
    }
300296
def process_lpd(name, dir_tmp):
    
    logger_doi_main.info("enter process_lpd")
    dir_root = os.getcwd()
    dir_bag = os.path.join(dir_tmp, name)
    dir_data = os.path.join(dir_bag, 'data')

    # Navigate down to jLD file
    # dir : dir_root -> dir_data
    os.chdir(dir_data)

    # Open jld file and read in the contents. Execute DOI Resolver.
    jld_data = read_json_from_file(os.path.join(dir_data, name + '.jsonld'))

    # Overwrite data with new data
    jld_data = DOIResolver(dir_root, name, jld_data).main()
    # Open the jld file and overwrite the contents with the new data.
    write_json_to_file(jld_data)

    # Open changelog. timestamp it. Prompt user for short description of changes. Close and save
    # update_changelog()

    # Delete old bag files, and move files to bag root for re-bagging
    # dir : dir_data -> dir_bag
    dir_cleanup(dir_bag, dir_data)
    finish_bag(dir_bag)

    logger_doi_main.info("exit process_lpd")
    return
1184884
function f_rol_sil_kullanici(_kul_id, _tahta_id, _rol_id) {
        if (_rol_id) {
            return result.dbQ.hget_json_parse(result.kp.tahta.hsUyeleri(_tahta_id), _kul_id)
                .then(function (_arrUyeRolId) {
                    // tek bir sayı ya da bir dizi gelebilir ve biz diziyle yola devam etmek için concat yapıyoruz
                    _arrUyeRolId = [].concat(_arrUyeRolId);
                    var idxOfRolId = _arrUyeRolId.indexOf(_rol_id);
                    l.info("idxOfRolId>" + idxOfRolId);

                    if (idxOfRolId == -1) {
                        return 0;
                    } else {
                        _arrUyeRolId.splice(idxOfRolId, 1);
                        return result.dbQ.hset(result.kp.tahta.hsUyeleri(_tahta_id), _kul_id, JSON.stringify(_arrUyeRolId));
                    }
                });
        } else {
            l.warning("Silinecek aktif bir rol bulunamadı");
        }
    }
213602
@Override
    public void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
        try (AeronNDArrayPublisher publisher = AeronNDArrayPublisher.builder().streamId(streamId).ctx(aeronContext)
                        .channel(masterUrl).build()) {
            publisher.publish(NDArrayMessage.builder().arr(arr).dimensions(dimensions).index(idx).build());
            log.debug("NDArray PublishingListener publishing to channel " + masterUrl + ":" + streamId);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1088907
synchronized long getNewDirectoryId(JournalContext context) throws UnavailableException {
    initialize(context);
    long containerId = mNextDirectoryId.getContainerId();
    long sequenceNumber = mNextDirectoryId.getSequenceNumber();
    long directoryId = BlockId.createBlockId(containerId, sequenceNumber);
    if (sequenceNumber == BlockId.getMaxSequenceNumber()) {
      // No more ids in this container. Get a new container for the next id.
      containerId = mContainerIdGenerator.getNewContainerId();
      sequenceNumber = 0;
    } else {
      sequenceNumber++;
    }
    applyAndJournal(context, toEntry(containerId, sequenceNumber));
    return directoryId;
  }
899112
public void fromJSON(JSONObject json, String rootPath) {

        try {
            // language versions
            if (json.has(JSON_LANGUAGES)) {
                JSONArray jsonLanguages = json.getJSONArray(JSON_LANGUAGES);
                for (int i = 0; i < jsonLanguages.length(); i++) {
                    JSONObject jsonLang = (JSONObject)jsonLanguages.get(i);

                    CmsDocumentDependency lang = new CmsDocumentDependency(null, jsonLang.getString(JSON_PATH));
                    lang.fromJSON(jsonLang, rootPath);
                    addVariant(lang);
                }
            }

            // attachments
            if (json.has(JSON_ATTACHMENTS)) {
                JSONArray jsonAttachments = json.getJSONArray(JSON_ATTACHMENTS);
                for (int i = 0; i < jsonAttachments.length(); i++) {
                    try {
                        JSONObject jsonAttachment = (JSONObject)jsonAttachments.get(i);

                        CmsDocumentDependency att = new CmsDocumentDependency(
                            null,
                            jsonAttachment.getString(JSON_PATH));
                        att.fromJSON(jsonAttachment, rootPath);

                        // language versions of attachment
                        if (jsonAttachment.has(JSON_LANGUAGES)) {
                            JSONArray jsonAttLanguages = jsonAttachment.getJSONArray(JSON_LANGUAGES);
                            for (int j = 0; j < jsonAttLanguages.length(); j++) {
                                JSONObject jsonAttLanguage = (JSONObject)jsonAttLanguages.get(j);

                                CmsDocumentDependency attLang = new CmsDocumentDependency(
                                    null,
                                    jsonAttLanguage.getString(JSON_PATH));
                                attLang.fromJSON(jsonAttLanguage, rootPath);
                                att.addVariant(attLang);
                            }
                        }
                        addAttachment(att);
                    } catch (Exception e) {
                        LOG.error(e);
                    }
                }
            }
        } catch (Exception ex) {
            if (LOG.isErrorEnabled()) {
                LOG.error(ex.getLocalizedMessage(), ex);
            }
        }
    }
12625
public static JsonLongDocument create(String id, Long content) {
        return new JsonLongDocument(id, 0, content, 0, null);
    }
191696
public function delete($appId, array $ids, $guestSpaceId = null, array $revisions = []): array
    {
        $options = ['json' => ['app' => $appId, 'ids' => $ids]];
        if (count($revisions) && count($ids) === count($revisions)) {
            $options['json']['revisions'] = $revisions;
        }

        /** @var JsonStream $stream */
        $stream = $this->client
            ->delete(KintoneApi::generateUrl('records.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
678633
public static function calToJd($calendar_id, $month, $day, $year)
    {
        switch ($calendar_id) {
            case CAL_FRENCH:
                return self::frenchToJd($month, $day, $year);

            case CAL_GREGORIAN:
                return self::gregorianToJd($month, $day, $year);

            case CAL_JEWISH:
                return self::jewishToJd($month, $day, $year);

            case CAL_JULIAN:
                return self::julianToJd($month, $day, $year);

            default:
                return trigger_error('invalid calendar ID ' . $calendar_id . '.', E_USER_WARNING);
        }
    }