// Path: src/main/java/com/codefork/refine/Config.java
// @Service
// public class Config {
// 
//     public static final String DEFAULT_SERVICE_NAME = "VIAF Reconciliation Service";
//     private static final String CONFIG_FILENAME = "refine_viaf.properties";
// 
//     private Log log = LogFactory.getLog(Config.class);
//     private String serviceName = DEFAULT_SERVICE_NAME;
//     private Properties properties = new Properties();
// 
//     public Config() {
//         if(new File(CONFIG_FILENAME).exists()) {
//             try {
//                 properties.load(new FileInputStream(CONFIG_FILENAME));
//             } catch (IOException ex) {
//                 log.error("Error reading config file, skipping it: " + ex);
//             }
//         }
//         setServiceName(properties.getProperty("service_name", getServiceName()));
//     }
// 
//     public String getServiceName() {
//         return serviceName;
//     }
// 
//     public void setServiceName(String serviceName) {
//         this.serviceName = serviceName;
//     }
// 
//     public Properties getProperties() {
//         return properties;
//     }
// }
// 
// Path: src/main/java/com/codefork/refine/NameType.java
// public enum NameType {
//     Person("/people/person", "Person", "Personal", "local.personalNames all \"%s\""),
//     Organization("/organization/organization", "Corporate Name", "Corporate", "local.corporateNames all \"%s\""),
//     Location("/location/location", "Geographic Name", "Geographic", "local.geographicNames all \"%s\""),
//     // can't find better freebase ids for these two
//     Book("/book/book", "Work", "UniformTitleWork", "local.uniformTitleWorks all \"%s\""),
//     Edition("/book/book edition", "Expression", "UniformTitleExpression", "local.uniformTitleExpressions all \"%s\"");
// 
//     // ids are from freebase identifier ns
//     private final String id;
//     private final String displayName;
//     private final String viafCode;
//     private final String cqlString;
// 
//     NameType(String id, String displayName, String viafCode, String cqlString) {
//        this.id = id;
//        this.displayName = displayName;
//        this.viafCode = viafCode;
//        this.cqlString = cqlString;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public String getViafCode() {
//         return viafCode;
//     }
// 
//     public String getCqlString() {
//         return cqlString;
//     }
// 
//     public VIAFNameType asVIAFNameType() {
//         return new VIAFNameType(getId(), getDisplayName());
//     }
// 
//     public static NameType getByViafCode(String viafCodeArg) {
//         for(NameType nameType: NameType.values()) {
//             if(nameType.viafCode.equals(viafCodeArg)) {
//                 return nameType;
//             }
//         }
//         return null;
//     }
// 
//     public static NameType getById(String idArg) {
//         for(NameType nameType: NameType.values()) {
//             if(nameType.id.equals(idArg)) {
//                 return nameType;
//             }
//         }
//         return null;
//     }
// 
// }


import com.codefork.refine.Config;
import com.codefork.refine.NameType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
import java.util.List;
package com.codefork.refine.resources;



/**
 * Metadata about this reconciliation service, operating in normal VIAF mode.
 */
public class ServiceMetaDataResponse {

    Log log = LogFactory.getLog(ServiceMetaDataResponse.class);

    public static class View {
        private String url;

        public View(String url) {
            this.url = url;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    
    }
    
    private String name = "";
    private final static String IDENTIFIER_SPACE = "http://rdf.freebase.com/ns/user/hangy/viaf";
    private final static View VIEW = new View("http://viaf.org/viaf/{{id}}");
    private final static String SCHEMA_SPACE = "http://rdf.freebase.com/ns/type.object.id";
    private final static List<VIAFNameType> DEFAULT_TYPES = new ArrayList<VIAFNameType>();

    static {
        for(NameType nameType : NameType.values()) {
            DEFAULT_TYPES.add(nameType.asVIAFNameType());
        }
    }
    
// Path: src/main/java/com/codefork/refine/Config.java
// @Service
// public class Config {
// 
//     public static final String DEFAULT_SERVICE_NAME = "VIAF Reconciliation Service";
//     private static final String CONFIG_FILENAME = "refine_viaf.properties";
// 
//     private Log log = LogFactory.getLog(Config.class);
//     private String serviceName = DEFAULT_SERVICE_NAME;
//     private Properties properties = new Properties();
// 
//     public Config() {
//         if(new File(CONFIG_FILENAME).exists()) {
//             try {
//                 properties.load(new FileInputStream(CONFIG_FILENAME));
//             } catch (IOException ex) {
//                 log.error("Error reading config file, skipping it: " + ex);
//             }
//         }
//         setServiceName(properties.getProperty("service_name", getServiceName()));
//     }
// 
//     public String getServiceName() {
//         return serviceName;
//     }
// 
//     public void setServiceName(String serviceName) {
//         this.serviceName = serviceName;
//     }
// 
//     public Properties getProperties() {
//         return properties;
//     }
// }
// 
// Path: src/main/java/com/codefork/refine/NameType.java
// public enum NameType {
//     Person("/people/person", "Person", "Personal", "local.personalNames all \"%s\""),
//     Organization("/organization/organization", "Corporate Name", "Corporate", "local.corporateNames all \"%s\""),
//     Location("/location/location", "Geographic Name", "Geographic", "local.geographicNames all \"%s\""),
//     // can't find better freebase ids for these two
//     Book("/book/book", "Work", "UniformTitleWork", "local.uniformTitleWorks all \"%s\""),
//     Edition("/book/book edition", "Expression", "UniformTitleExpression", "local.uniformTitleExpressions all \"%s\"");
// 
//     // ids are from freebase identifier ns
//     private final String id;
//     private final String displayName;
//     private final String viafCode;
//     private final String cqlString;
// 
//     NameType(String id, String displayName, String viafCode, String cqlString) {
//        this.id = id;
//        this.displayName = displayName;
//        this.viafCode = viafCode;
//        this.cqlString = cqlString;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public String getViafCode() {
//         return viafCode;
//     }
// 
//     public String getCqlString() {
//         return cqlString;
//     }
// 
//     public VIAFNameType asVIAFNameType() {
//         return new VIAFNameType(getId(), getDisplayName());
//     }
// 
//     public static NameType getByViafCode(String viafCodeArg) {
//         for(NameType nameType: NameType.values()) {
//             if(nameType.viafCode.equals(viafCodeArg)) {
//                 return nameType;
//             }
//         }
//         return null;
//     }
// 
//     public static NameType getById(String idArg) {
//         for(NameType nameType: NameType.values()) {
//             if(nameType.id.equals(idArg)) {
//                 return nameType;
//             }
//         }
//         return null;
//     }
// 
// }


// Path: src/main/java/com/codefork/refine/resources/ServiceMetaDataResponse.java
import com.codefork.refine.Config;
import com.codefork.refine.NameType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
import java.util.List;

package com.codefork.refine.resources;



/**
 * Metadata about this reconciliation service, operating in normal VIAF mode.
 */
public class ServiceMetaDataResponse {

    Log log = LogFactory.getLog(ServiceMetaDataResponse.class);

    public static class View {
        private String url;

        public View(String url) {
            this.url = url;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    
    }
    
    private String name = "";
    private final static String IDENTIFIER_SPACE = "http://rdf.freebase.com/ns/user/hangy/viaf";
    private final static View VIEW = new View("http://viaf.org/viaf/{{id}}");
    private final static String SCHEMA_SPACE = "http://rdf.freebase.com/ns/type.object.id";
    private final static List<VIAFNameType> DEFAULT_TYPES = new ArrayList<VIAFNameType>();

    static {
        for(NameType nameType : NameType.values()) {
            DEFAULT_TYPES.add(nameType.asVIAFNameType());
        }
    }
    
    public ServiceMetaDataResponse(Config config, String source) {