<commit_before>package org.zaizi.mico.client.query.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.openrdf.model.URI;
import org.zaizi.mico.client.QueryClient;
import org.zaizi.mico.client.exception.MicoClientException;
import org.zaizi.mico.client.model.ContentItem;
import org.zaizi.mico.client.model.face.FaceFragment;
import org.zaizi.mico.client.model.text.LinkedEntity;
import org.zaizi.mico.client.model.text.LinkedEntityBody;

import com.github.anno4j.Anno4j;
import com.github.anno4j.model.Annotation;
import com.github.anno4j.model.Selector;
import com.github.anno4j.model.Target;
import com.github.anno4j.model.impl.selector.FragmentSelector;
import com.github.anno4j.model.impl.targets.SpecificResource;
import com.github.anno4j.querying.QueryService;

import eu.mico.platform.anno4j.model.namespaces.MICO;

public class QueryClientImpl implements QueryClient
{

    private Anno4j anno4j;
    private QueryService queryService;

    public QueryClientImpl(Anno4j anno4j)
    {
        this.anno4j = anno4j;
        queryService = this.anno4j.createQueryService();

    }

    @Override
    public List<LinkedEntity> getLinkedEntities(ContentItem contentItem) throws MicoClientException
    {
        List<LinkedEntity> linkedEntities = new ArrayList<LinkedEntity>();
        try
        {
            queryService.addPrefix(MICO.PREFIX, MICO.NS).addCriteria("^mico:hasContent/^mico:hasContentPart",
                    contentItem.getID());<commit_msg>adding fam namespace to the relevant query<commit_after>package org.zaizi.mico.client.query.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.openrdf.model.URI;
import org.zaizi.mico.client.QueryClient;
import org.zaizi.mico.client.exception.MicoClientException;
import org.zaizi.mico.client.model.ContentItem;
import org.zaizi.mico.client.model.face.FaceFragment;
import org.zaizi.mico.client.model.namespace.FAM;
import org.zaizi.mico.client.model.text.LinkedEntity;
import org.zaizi.mico.client.model.text.LinkedEntityBody;

import com.github.anno4j.Anno4j;
import com.github.anno4j.model.Annotation;
import com.github.anno4j.model.Selector;
import com.github.anno4j.model.Target;
import com.github.anno4j.model.impl.selector.FragmentSelector;
import com.github.anno4j.model.impl.targets.SpecificResource;
import com.github.anno4j.querying.QueryService;

import eu.mico.platform.anno4j.model.namespaces.MICO;

public class QueryClientImpl implements QueryClient
{

    private Anno4j anno4j;
    private QueryService queryService;

    public QueryClientImpl(Anno4j anno4j)
    {
        this.anno4j = anno4j;
        queryService = this.anno4j.createQueryService();

    }

    @Override
    public List<LinkedEntity> getLinkedEntities(ContentItem contentItem) throws MicoClientException
    {
        List<LinkedEntity> linkedEntities = new ArrayList<LinkedEntity>();
        try
        {
            queryService.addPrefix(MICO.PREFIX, MICO.NS).addPrefix(FAM.PREFIX, FAM.NS).addCriteria("^mico:hasContent/^mico:hasContentPart",
                    contentItem.getID());
{'fraction_non_alphanumeric': 0.1045730732331308, 'fraction_numerical': 0.010233450591621363, 'mean_word_length': 4.347008547008547, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4555861', 'n_tokens_mistral': 1021, 'n_tokens_neox': 1003, 'n_words': 150}