<commit_before>//==============================================================================
// CellML file RDF triple
//==============================================================================

#include "cellmlfilerdftriple.h"

//==============================================================================

#include "cellml-api-cxx-support.hpp"

//==============================================================================

namespace OpenCOR {
namespace CellMLSupport {

//==============================================================================

CellmlFileRdfTriple::CellmlFileRdfTriple(iface::rdf_api::Triple *pTriple)
{
    // Retrieve the triple's subject information

    ObjRef<iface::rdf_api::Resource> subject = pTriple->subject();
    ObjRef<iface::rdf_api::URIReference> subjectUriReference;
    QUERY_INTERFACE(subjectUriReference, subject, rdf_api::URIReference);

    if (subjectUriReference) {
        mSubjectType = Uri;
        mSubject     = QString::fromStdWString(subjectUriReference->URI());
    } else {
        mSubjectType = ObjId;
        mSubject     = QString::fromStdString(subject->objid());
    }

    // Retrieve the triple's predicate information

    ObjRef<iface::rdf_api::Resource> predicate = pTriple->predicate();
    ObjRef<iface::rdf_api::URIReference> predicateUriReference;
    QUERY_INTERFACE(predicateUriReference, predicate, rdf_api::URIReference);

    if (predicateUriReference) {
        mPredicateType = Uri;
        mPredicate     = QString::fromStdWString(predicateUriReference->URI());
    } else {
        mPredicateType = ObjId;
        mPredicate     = QString::fromStdString(predicate->objid());
    }

    // Retrieve the triple's object information

    ObjRef<iface::rdf_api::Node> object = pTriple->object();
    ObjRef<iface::rdf_api::URIReference> objectUriReference;
    QUERY_INTERFACE(objectUriReference, object, rdf_api::URIReference);

    if (objectUriReference) {
        mObjectType  = Uri;
        mObject      = QString::fromStdWString(objectUriReference->URI());<commit_msg>Working on retrieving existing annotations from a CellML file (#73).<commit_after>//==============================================================================
// CellML file RDF triple
//==============================================================================

#include "cellmlfilerdftriple.h"

//==============================================================================

#include "cellml-api-cxx-support.hpp"

//==============================================================================

namespace OpenCOR {
namespace CellMLSupport {

//==============================================================================

CellmlFileRdfTriple::CellmlFileRdfTriple(iface::rdf_api::Triple *pTriple)
{
    // Retrieve the triple's subject information

    ObjRef<iface::rdf_api::Resource> subject = pTriple->subject();
    ObjRef<iface::rdf_api::URIReference> subjectUriReference;
    QUERY_INTERFACE(subjectUriReference, subject, rdf_api::URIReference);

qDebug("---------------------------------------");
qDebug("Subject - Supported interfaces:");
std::vector<std::string> supportedInterfaces = subject->supported_interfaces();
for (int i = 0, iMax = supportedInterfaces.size(); i < iMax; ++i)
    qDebug(" - %s", supportedInterfaces[i].c_str());

    if (subjectUriReference) {
        mSubjectType = Uri;
        mSubject     = QString::fromStdWString(subjectUriReference->URI());
    } else {
        mSubjectType = ObjId;
        mSubject     = QString::fromStdString(subject->objid());
    }

    // Retrieve the triple's predicate information

    ObjRef<iface::rdf_api::Resource> predicate = pTriple->predicate();
    ObjRef<iface::rdf_api::URIReference> predicateUriReference;
    QUERY_INTERFACE(predicateUriReference, predicate, rdf_api::URIReference);

qDebug("---------------------------------------");
qDebug("Predicate - Supported interfaces:");
supportedInterfaces = predicate->supported_interfaces();
for (int i = 0, iMax = supportedInterfaces.size(); i < iMax; ++i)
    qDebug(" - %s", supportedInterfaces[i].c_str());

    if (predicateUriReference) {
        mPredicateType = Uri;
        mPredicate     = QString::fromStdWString(predicateUriReference->URI());
    } else {
        mPredicateType = ObjId;
        mPredicate     = QString::fromStdString(predicate->objid());
    }

    // Retrieve the triple's object information

    ObjRef<iface::rdf_api::Node> object = pTriple->object();
    ObjRef<iface::rdf_api::URIReference> objectUriReference;
    QUERY_INTERFACE(objectUriReference, object, rdf_api::URIReference);

qDebug("---------------------------------------");
qDebug("Object - Supported interfaces:");
supportedInterfaces = object->supported_interfaces();
for (int i = 0, iMax = supportedInterfaces.size(); i < iMax; ++i)
    qDebug(" - %s", supportedInterfaces[i].c_str());

    if (objectUriReference) {
        mObjectType  = Uri;
        mObject      = QString::fromStdWString(objectUriReference->URI());
{'fraction_non_alphanumeric': 0.2863681592039801, 'fraction_numerical': 0.0009950248756218905, 'mean_word_length': 4.541345093715546, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4737929', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1303, 'n_words': 227}