<div about="{{ targetres }}" class="card service" typeof="schema:SoftwareApplication">
    <div class="topbar">
        <div class="developmentStatus" property="codemeta:developmentStatus">
            <ul>
            {% for _,_, devstatres in chain(g.triples((targetres, CODEMETA.developmentStatus, None)),g.triples((res, CODEMETA.developmentStatus, None))) %}
            {% include 'developmentstatus.html' %}
            {% endfor %}
            </ul>
        </div>
    </div>

    {% if (targetres, SDO.thumbnailUrl, None) in g %}
    <img class="thumbnail" src="{{ g.value(res, SDO.thumbnailUrl) }}" alt="thumbnail/logo" />
    {% elif (res, SDO.thumbnailUrl, None) in g %}
    <img class="thumbnail" src="{{ g.value(res, SDO.thumbnailUrl) }}" alt="thumbnail/logo" />
    {% endif %}

    <h2>
        <span class="name" property="schema:name">
        {% if baseuri and toolstore %}
        <a href="{{ res }}" title="Go to the overview page for this tool">
        {% endif %}
        {{ g.value(targetres, SDO.name) }}
        {% if baseuri %}
        </a>
        {% endif %}
        </span>
        <span class="version">
            {% if  (targetres, SDO.version, None) in g %}
                {% if g.value(targetres, SDO.releaseNotes) %}
                <a rel="schema:releaseNotes" href="{{ g.value(targetres, SDO.releaseNotes) }}" title="release notes for this version">
                {% elif g.value(res, SDO.releaseNotes) %}
                <a rel="schema:releaseNotes" href="{{ g.value(res, SDO.releaseNotes) }}" title="release notes for the source code of this version">
                {% endif %}
                <span property="schema:version">{{ g.value(targetres, SDO.version) }}</a>
                {% if g.value(res, SDO.releaseNotes)  or g.value(res, SDO.releaseNotes) %}
                </a>
                {% endif %}
            {% elif  (res, SDO.version, None) in g %}
                {% if g.value(res, SDO.releaseNotes) %}
                <a rel="schema:releaseNotes" href="{{ g.value(res, SDO.releaseNotes) }}" title="release notes for the source code of this version">
                {% endif %}
                <span property="schema:version">{{ g.value(res, SDO.version) }}</a>
                {% if g.value(res, SDO.releaseNotes) %}
                </a>
                {% endif %}
            {% endif %}
        </span>
    </h2>

    {% if (targetres, SDO.author, None) in g %}
    <div class="author">
        <ul>
         {% for label, pores in get_triples(g, targetres, SDO.author) %}
         <li{% if (targetres, SDO.maintainer, pores) in g %} class="maintainer"{% endif %}>{% include 'person_or_org_minimal.html' %}</li>
         {% endfor %}
        </ul>
    </div>
    {% elif (res, SDO.author, None) in g %}
    <div class="author">
        <ul>
         {% for label, pores in get_triples(g, res, SDO.author) %}
         <li{% if (res, SDO.maintainer, pores) in g %} class="maintainer"{% endif %}>{% include 'person_or_org_minimal.html' %}</li>
         {% endfor %}
        </ul>
    </div>
    {% endif %}

    {% if (targetres, SDO.provider, None) in g %}
    <div class="provider">
        <ul>
         {% for label, pores in get_triples(g, targetres, SDO.provider) %}
         <li>{% include 'person_or_org.html' %}</li>
         {% endfor %}
        </ul>
    </div>
    {% endif %}

    {% if (res, SDO.producer, None) in g %}
    <div class="producer">
        <ul>
         {% for label, pores in get_triples(g, res, SDO.producer) %}
         <li>{% include 'person_or_org.html' %}</li>
         {% endfor %}
        </ul>
    </div>
    {% endif %}

    <div class="description">
        {% if  (targetres, SDO.description, None) in g %}
        <em property="schema:description">{{ g.value(targetres, SDO.description) }}</em> {% if baseuri %}[<a href="{{ res }}">view more</a>]{% endif %}
        {% elif  (res, SDO.description, None) in g %}
        <em property="schema:description">{{ g.value(res, SDO.description) }}</em> {% if baseuri %}[<a href="{{ res }}">view more</a>]{% endif %}
        {% else %}
        <span class="negative">No description provided</span>
        {% endif %}
    </div>



    {% if (targetres, SDO.applicationCategory, None) in g %}
    <div class="category">
        <i class="fa fa-sitemap" title="Category"></i> <ul>
         {% for label, catres in get_triples(g, targetres, SDO.applicationCategory, abcsort=True) %}
             <li property="schema:applicationCategory" title="{{ get_description(contextgraph, catres) }}">{{ label }}</li>
         {% endfor %}
        </ul>
    </div>
    {% elif (res, SDO.applicationCategory, None) in g %}
    <div class="category">
        <i class="fa fa-sitemap" title="Category"></i> <ul>
         {% for label, catres in get_triples(g, res, SDO.applicationCategory, abcsort=True) %}
            <li property="schema:applicationCategory" title="{{ get_description(contextgraph, catres) }}">{{ label }}</li>
         {% endfor %}
        </ul>
    </div>
    {% endif %}

    {% if (targetres, SDO.keywords, None) in g %}
    <div class="keywords">
        <i class="fa fa-tags" title="Keywords"></i> <ul>
         {% for label, _ in get_triples(g, targetres, SDO.keywords, abcsort=True) %}
            <li property="schema:keywords">{{ label }}</li>
         {% endfor %}
         </ul>
    </div>
    {% elif (res, SDO.keywords, None) in g %}
    <div class="keywords">
        <i class="fa fa-tags" title="Keywords"></i> <ul>
         {% for label, _ in get_triples(g, res, SDO.keywords, abcsort=True) %}
            <li property="schema:keywords">{{ label }}</li>
         {% endfor %}
         </ul>
    </div>
    {% endif %}


    <div class="minilinks">
        {% for _,_, license in chain(g.triples((targetres, SDO.license, None)),g.triples((res, SDO.license, None))) %}
        {% if (license, SDO.name, None) in contextgraph %}
            <a href="{{ license }}"><i class="fa fa-copyright" title="License: {{ contextgraph.value(license, SDO.name) }}"></i></a>
        {% elif license.startswith("http") %}
            <a href="{{ license }}"><i class="fa fa-copyright" title="License: {{ license }}"></i></a>
        {% else %}
            <i class="fa fa-copyright" title="License: {{ license }}"></i>
        {% endif %}
        {% endfor %}

        {% for _,_, res2 in chain(g.triples((targetres, SDO.softwareHelp, None)), g.triples((res, SDO.softwareHelp, None))) %}
            {% if g.value(res2, SDO.name) and g.value(res2, SDO.url) %}
            <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-book" title="Documentation: {{ g.value(res2, SDO.name) }}"></i></a>
            {% elif g.value(res2, SDO.url) %}
            <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-book" title="Documentation: {{ g.value(res2, SDO.url) }}"></i></a>
            {% endif %}
        {% endfor %}
        {% for _,_, res2 in chain(g.triples((targetres, SDO.documentation, None)), g.triples((res, SDO.documentation, None))) %}
            {% if g.value(res2, SDO.name) and g.value(res2, SDO.url) %}
            <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-book" title="Documentation: {{ g.value(res2, SDO.name) }}"></i></a>
            {% elif g.value(res2, SDO.url) %}
            <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-book" title="Documentation: {{ g.value(res2, SDO.url) }}"></i></a>
            {% endif %}
        {% endfor %}
        {% for title, res2 in chain(get_triples(g, targetres, CODEMETA.referencePublication),  get_triples(g, res, CODEMETA.referencePublication)) %}
            {% if res2 and g.value(res2, SDO.url) %}
            <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-quote-right" title="Reference Publication: {{ title }}"></i></a>
            {% else %}
            <i class="fa fa-quote-right" title="Reference Publication: {{ title }}"></i>
            {% endif %}
        {% endfor %}
        {% for title, res2 in chain(get_triples(g, targetres, SDO.citation),get_triples(g, res, SDO.citation)) %}
            {% if res2 and g.value(res2, SDO.url) %}
            <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-quote-right" title="Reference Publication: {{ title }}"></i></a>
            {% else %}
            <i class="fa fa-quote-right" title="Reference Publication: {{ title }}"></i>
            {% endif %}
        {% endfor %}
        {% for label, res2 in get_triples(g, res, CODEMETA.funding, abcsort=True) %}
            {% if res2 and g.value(res2, SDO.url) %}
                <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-dollar-sign" title="Funding: {{ label }}"></i></a>
            {% else %}
                <i class="fa fa-dollar-sign" title="Funding: {{ label }}"></i>
            {% endif %}
        {% endfor %}
        {% for label, res2 in get_triples(g, targetres, SDO.funder, abcsort=True) %}
            {% if res2 and g.value(res2, SDO.url) %}
                <a href="{{ g.value(res2, SDO.url) }}"><i class="fa fa-dollar-sign" title="Funding: {{ label }}"></i></a>
            {% else %}
                <i class="fa fa-dollar-sign" title="Funding: {{ label }}"></i>
            {% endif %}
        {% endfor %}
    </div>

    <div class="links">
        <ul>
        {% if (targetres, SDO.url, None) in g %}
        <li class="go">
            <i class="fa fa-globe"></i>
            <a rel="schema:url" href="{{ g.value(targetres, SDO.url) }}">
                <strong>Go to {{ g.value(targetres, SDO.name) }}</strong></em>
                <tt>{{ g.value(targetres, SDO.url) }}</tt>
            </a>
        </li>
        {% endif %}


        {% if g.value(res, SDO.url) %}
        <li><i class="fa fa-home"></i>&nbsp;<a rel="schema:url" href="{{ g.value(res, SDO.url) }}" title="This is the project website associated with this software">Website</a></li>
        {% endif %}

        {% if  (res, SDO.codeRepository, None) in g %}
        <li><i class="fa fa-code-branch"></i>&nbsp;<a rel="schema:codeRepository" href="{{ g.value(res, SDO.codeRepository) }}" title="Here you can find the source code of this software. This is geared towards technical users who want to install the software themselves.">Source code</a></li>
        {% endif %}

        </ul>
    </div>

    <div class="dateCreated">
        {% if  (targetres, SDO.dateCreated, None) in g %}
        Created: <span class="dateCreated" property="schema:dateCreated" title="Date at which the first version was provided">{{ g.value(targetres, SDO.dateCreated).split("T")[0]}}</span>
        {% elif  (res, SDO.dateCreated, None) in g %}
        Created: <span class="dateCreated" property="schema:dateCreated" title="Date at which the first version's source code was created">{{ g.value(res, SDO.dateCreated).split("T")[0]}}</span>
        {% endif %}
    </div>

    <div class="dateModified">
        {% if  (targetres, SDO.dateModified, None) in g %}
        Modified: <span class="dateModified" property="schema:dateModified" title="Date at which this version was last modified">{{ g.value(targetres, SDO.dateModified).split("T")[0] }}</span>
        {% elif  (res, SDO.dateModified, None) in g %}
        Modified: <span class="dateModified" property="schema:dateModified" title="Date at which this version's source code was last modified">{{ g.value(res, SDO.dateModified).split("T")[0] }}</span>
        {% endif %}
    </div>
</div>
