Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Feb 5, 2020
1 parent 0c9e02c commit 549a4ec
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/plugins/support/CellMLSupport/src/cellmlfilerdftriple.cpp
Expand Up @@ -68,13 +68,9 @@ CellmlFileRdfTriple::CellmlFileRdfTriple(CellmlFile *pCellmlFile,
{
// Retrieve the RDF triple's subject, predicate and object information

ObjRef<iface::rdf_api::Resource> subject = pRdfTriple->subject();
ObjRef<iface::rdf_api::Resource> predicate = pRdfTriple->predicate();
ObjRef<iface::rdf_api::Node> object = pRdfTriple->object();

mSubject = new CellmlFileRdfTripleElement(subject);
mPredicate = new CellmlFileRdfTripleElement(predicate);
mObject = new CellmlFileRdfTripleElement(object);
mSubject = new CellmlFileRdfTripleElement(pRdfTriple->subject());
mPredicate = new CellmlFileRdfTripleElement(pRdfTriple->predicate());
mObject = new CellmlFileRdfTripleElement(pRdfTriple->object());

// Determine the type of the RDF triple

Expand Down Expand Up @@ -593,22 +589,15 @@ CellmlFileRdfTriple * CellmlFileRdfTriples::add(CellmlFileRdfTriple *pRdfTriple)
// Create a CellML API version of the RDF triple

ObjRef<iface::rdf_api::DataSource> dataSource = mCellmlFile->rdfDataSource();

ObjRef<iface::rdf_api::Resource> subject = already_AddRefd<iface::rdf_api::Resource>(dataSource->getURIReference(pRdfTriple->subject()->asString().toStdWString()));
ObjRef<iface::rdf_api::Resource> predicate = already_AddRefd<iface::rdf_api::Resource>(dataSource->getURIReference(pRdfTriple->predicate()->asString().toStdWString()));
ObjRef<iface::rdf_api::Node> object = already_AddRefd<iface::rdf_api::Node>(dataSource->getURIReference(pRdfTriple->object()->asString().toStdWString()));

subject->createTripleOutOf(predicate, object);

// Keep track of the CellML API version of the RDF triple in pRdfTriple
// Note: in debug mode, we also check that we actually managed to retrieve
// the CellML API version of our RDF triple...

ObjRef<iface::rdf_api::Triple> rdfTriple = subject->getTripleOutOfByPredicateAndObject(predicate, object);

Q_ASSERT(rdfTriple);

pRdfTriple->setRdfTriple(rdfTriple);
pRdfTriple->setRdfTriple(subject->getTripleOutOfByPredicateAndObject(predicate, object));

// An RDF triple has been added, so update the CellML file's modified status

Expand Down

0 comments on commit 549a4ec

Please sign in to comment.