id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
120,300 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/BackendManager.java | BackendManager.createDispatcher | private RequestDispatcher createDispatcher(String pDispatcherClass,
Converters pConverters,
ServerHandle pServerHandle,
Restrictor pRestrictor,
... | java | private RequestDispatcher createDispatcher(String pDispatcherClass,
Converters pConverters,
ServerHandle pServerHandle,
Restrictor pRestrictor,
... | [
"private",
"RequestDispatcher",
"createDispatcher",
"(",
"String",
"pDispatcherClass",
",",
"Converters",
"pConverters",
",",
"ServerHandle",
"pServerHandle",
",",
"Restrictor",
"pRestrictor",
",",
"Configuration",
"pConfig",
")",
"{",
"try",
"{",
"Class",
"clazz",
"=... | Create a single dispatcher | [
"Create",
"a",
"single",
"dispatcher"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L380-L419 |
120,301 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/BackendManager.java | BackendManager.callRequestDispatcher | private JSONObject callRequestDispatcher(JmxRequest pJmxReq)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
Object retValue = null;
boolean useValueWithPath = false;
boolean found = false;
... | java | private JSONObject callRequestDispatcher(JmxRequest pJmxReq)
throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
Object retValue = null;
boolean useValueWithPath = false;
boolean found = false;
... | [
"private",
"JSONObject",
"callRequestDispatcher",
"(",
"JmxRequest",
"pJmxReq",
")",
"throws",
"InstanceNotFoundException",
",",
"AttributeNotFoundException",
",",
"ReflectionException",
",",
"MBeanException",
",",
"IOException",
",",
"NotChangedException",
"{",
"Object",
"... | call the an appropriate request dispatcher | [
"call",
"the",
"an",
"appropriate",
"request",
"dispatcher"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L422-L449 |
120,302 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/BackendManager.java | BackendManager.initMBeans | private void initMBeans(Configuration pConfig) {
int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES);
int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES);
historyStore = new HistoryStore(maxEntries);
debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG));
... | java | private void initMBeans(Configuration pConfig) {
int maxEntries = pConfig.getAsInt(HISTORY_MAX_ENTRIES);
int maxDebugEntries = pConfig.getAsInt(DEBUG_MAX_ENTRIES);
historyStore = new HistoryStore(maxEntries);
debugStore = new DebugStore(maxDebugEntries, pConfig.getAsBoolean(DEBUG));
... | [
"private",
"void",
"initMBeans",
"(",
"Configuration",
"pConfig",
")",
"{",
"int",
"maxEntries",
"=",
"pConfig",
".",
"getAsInt",
"(",
"HISTORY_MAX_ENTRIES",
")",
";",
"int",
"maxDebugEntries",
"=",
"pConfig",
".",
"getAsInt",
"(",
"DEBUG_MAX_ENTRIES",
")",
";",... | init various application wide stores for handling history and debug output. | [
"init",
"various",
"application",
"wide",
"stores",
"for",
"handling",
"history",
"and",
"debug",
"output",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L462-L479 |
120,303 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/BackendManager.java | BackendManager.intError | private void intError(String message,Throwable t) {
logHandler.error(message, t);
debugStore.log(message, t);
} | java | private void intError(String message,Throwable t) {
logHandler.error(message, t);
debugStore.log(message, t);
} | [
"private",
"void",
"intError",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"logHandler",
".",
"error",
"(",
"message",
",",
"t",
")",
";",
"debugStore",
".",
"log",
"(",
"message",
",",
"t",
")",
";",
"}"
] | Final private error log for use in the constructor above | [
"Final",
"private",
"error",
"log",
"for",
"use",
"in",
"the",
"constructor",
"above"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L482-L485 |
120,304 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java | OptionsAndArgs.lookupJarFile | public static File lookupJarFile() {
try {
return new File(OptionsAndArgs.class
.getProtectionDomain()
.getCodeSource()
.getLocation()
.toURI());
} ... | java | public static File lookupJarFile() {
try {
return new File(OptionsAndArgs.class
.getProtectionDomain()
.getCodeSource()
.getLocation()
.toURI());
} ... | [
"public",
"static",
"File",
"lookupJarFile",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"File",
"(",
"OptionsAndArgs",
".",
"class",
".",
"getProtectionDomain",
"(",
")",
".",
"getCodeSource",
"(",
")",
".",
"getLocation",
"(",
")",
".",
"toURI",
"(",
"... | Lookup the JAR File from where this class is loaded
@return File pointing to the JAR-File from where this class was loaded. | [
"Lookup",
"the",
"JAR",
"File",
"from",
"where",
"this",
"class",
"is",
"loaded"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java#L257-L267 |
120,305 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java | OptionsAndArgs.getNextListIndexSuffix | private String getNextListIndexSuffix(Map<String, String> options, String key) {
if (!options.containsKey(key)) {
return "";
} else {
int i = 1;
while (options.containsKey(key + "." + i)) {
i++;
}
return "." + i;
}
} | java | private String getNextListIndexSuffix(Map<String, String> options, String key) {
if (!options.containsKey(key)) {
return "";
} else {
int i = 1;
while (options.containsKey(key + "." + i)) {
i++;
}
return "." + i;
}
} | [
"private",
"String",
"getNextListIndexSuffix",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"options",
",",
"String",
"key",
")",
"{",
"if",
"(",
"!",
"options",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"else",
"{",
... | check for the next key with a suffix like ".1" which is not already set | [
"check",
"for",
"the",
"next",
"key",
"with",
"a",
"suffix",
"like",
".",
"1",
"which",
"is",
"not",
"already",
"set"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java#L314-L324 |
120,306 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java | OptionsAndArgs.init | private void init(Set<String> pCommands, String ... pArgs) {
quiet = options.containsKey("quiet");
verbose = options.containsKey("verbose");
jarFile = lookupJarFile();
// Special cases first
extraArgs = checkCommandAndArgs(pCommands, pArgs);
} | java | private void init(Set<String> pCommands, String ... pArgs) {
quiet = options.containsKey("quiet");
verbose = options.containsKey("verbose");
jarFile = lookupJarFile();
// Special cases first
extraArgs = checkCommandAndArgs(pCommands, pArgs);
} | [
"private",
"void",
"init",
"(",
"Set",
"<",
"String",
">",
"pCommands",
",",
"String",
"...",
"pArgs",
")",
"{",
"quiet",
"=",
"options",
".",
"containsKey",
"(",
"\"quiet\"",
")",
";",
"verbose",
"=",
"options",
".",
"containsKey",
"(",
"\"verbose\"",
"... | Initialise default command and validate | [
"Initialise",
"default",
"command",
"and",
"validate"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java#L334-L341 |
120,307 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/CommandDispatcher.java | CommandDispatcher.dispatchCommand | public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
String commandName = options.getCommand();
AbstractBaseCommand command = COMMANDS.get(commandName);
if (command == null) {
throw new... | java | public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
String commandName = options.getCommand();
AbstractBaseCommand command = COMMANDS.get(commandName);
if (command == null) {
throw new... | [
"public",
"int",
"dispatchCommand",
"(",
"Object",
"pVm",
",",
"VirtualMachineHandler",
"pHandler",
")",
"throws",
"InvocationTargetException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
"{",
"String",
"commandName",
"=",
"options",
".",
"getCommand",
... | Dispatch the command
@param pVm the virtual machine to attach to (typeless in order avoid direct references to the sun classes)
@param pHandler handler for listing processes
@return the return code (0 or 1) | [
"Dispatch",
"the",
"command"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/CommandDispatcher.java#L72-L79 |
120,308 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/MBeanServerExecutorLocal.java | MBeanServerExecutorLocal.handleRequest | public <R extends JmxRequest> Object handleRequest(JsonRequestHandler<R> pRequestHandler, R pJmxReq)
throws MBeanException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, NotChangedException {
AttributeNotFoundException attrException = null;
InstanceNotFoundExcep... | java | public <R extends JmxRequest> Object handleRequest(JsonRequestHandler<R> pRequestHandler, R pJmxReq)
throws MBeanException, ReflectionException, AttributeNotFoundException, InstanceNotFoundException, NotChangedException {
AttributeNotFoundException attrException = null;
InstanceNotFoundExcep... | [
"public",
"<",
"R",
"extends",
"JmxRequest",
">",
"Object",
"handleRequest",
"(",
"JsonRequestHandler",
"<",
"R",
">",
"pRequestHandler",
",",
"R",
"pJmxReq",
")",
"throws",
"MBeanException",
",",
"ReflectionException",
",",
"AttributeNotFoundException",
",",
"Insta... | Handle a single request
@param pRequestHandler the handler which can deal with this request
@param pJmxReq the request to execute
@return the return value
@throws MBeanException
@throws ReflectionException
@throws AttributeNotFoundException
@throws InstanceNotFoundException | [
"Handle",
"a",
"single",
"request"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/MBeanServerExecutorLocal.java#L102-L124 |
120,309 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/JolokiaCipher.java | JolokiaCipher.encrypt | public String encrypt(final String pText) throws GeneralSecurityException {
byte[] clearBytes = pText.getBytes(Charset.forName("UTF-8"));
byte[] salt = getSalt(SALT_SIZE);
Cipher cipher = createCipher(salt, Cipher.ENCRYPT_MODE);
byte[] encryptedBytes = cipher.doFinal(clearBytes);
... | java | public String encrypt(final String pText) throws GeneralSecurityException {
byte[] clearBytes = pText.getBytes(Charset.forName("UTF-8"));
byte[] salt = getSalt(SALT_SIZE);
Cipher cipher = createCipher(salt, Cipher.ENCRYPT_MODE);
byte[] encryptedBytes = cipher.doFinal(clearBytes);
... | [
"public",
"String",
"encrypt",
"(",
"final",
"String",
"pText",
")",
"throws",
"GeneralSecurityException",
"{",
"byte",
"[",
"]",
"clearBytes",
"=",
"pText",
".",
"getBytes",
"(",
"Charset",
".",
"forName",
"(",
"\"UTF-8\"",
")",
")",
";",
"byte",
"[",
"]"... | Encrypt a string with a password.
@param pText text to encode
@return the encoded password | [
"Encrypt",
"a",
"string",
"with",
"a",
"password",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/JolokiaCipher.java#L54-L71 |
120,310 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/ParsedUri.java | ParsedUri.getParameter | public String getParameter(String name) {
String[] values = parameters.get(name);
if (values == null) {
return null;
}
if (values.length == 0) {
return "";
}
return values[0];
} | java | public String getParameter(String name) {
String[] values = parameters.get(name);
if (values == null) {
return null;
}
if (values.length == 0) {
return "";
}
return values[0];
} | [
"public",
"String",
"getParameter",
"(",
"String",
"name",
")",
"{",
"String",
"[",
"]",
"values",
"=",
"parameters",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"values",
"... | Get a single parameter of the parsed URI
@param name parameter name
@return the value of the parameter or <code>null</code>
if no such parameter is stored | [
"Get",
"a",
"single",
"parameter",
"of",
"the",
"parsed",
"URI"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/ParsedUri.java#L93-L103 |
120,311 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/ParsedUri.java | ParsedUri.parseQuery | private Map<String, String[]> parseQuery(String qs) {
Map<String, String[]> ret = new TreeMap<String, String[]>();
try {
String pairs[] = qs.split("&");
for (String pair : pairs) {
String name;
String value;
int pos = pair.indexOf(... | java | private Map<String, String[]> parseQuery(String qs) {
Map<String, String[]> ret = new TreeMap<String, String[]>();
try {
String pairs[] = qs.split("&");
for (String pair : pairs) {
String name;
String value;
int pos = pair.indexOf(... | [
"private",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parseQuery",
"(",
"String",
"qs",
")",
"{",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"ret",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"String",
"[",
"]",
">",
"(",
")",
... | parse the query | [
"parse",
"the",
"query"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/ParsedUri.java#L116-L151 |
120,312 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/AbstractBaseCommand.java | AbstractBaseCommand.getProcessDescription | protected String getProcessDescription(OptionsAndArgs pOpts, VirtualMachineHandler pHandler) {
if (pOpts.getPid() != null) {
return "PID " + pOpts.getPid();
} else if (pOpts.getProcessPattern() != null) {
StringBuffer desc = new StringBuffer("process matching \"")
... | java | protected String getProcessDescription(OptionsAndArgs pOpts, VirtualMachineHandler pHandler) {
if (pOpts.getPid() != null) {
return "PID " + pOpts.getPid();
} else if (pOpts.getProcessPattern() != null) {
StringBuffer desc = new StringBuffer("process matching \"")
... | [
"protected",
"String",
"getProcessDescription",
"(",
"OptionsAndArgs",
"pOpts",
",",
"VirtualMachineHandler",
"pHandler",
")",
"{",
"if",
"(",
"pOpts",
".",
"getPid",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"\"PID \"",
"+",
"pOpts",
".",
"getPid",
"(",
"... | Get a description of the process attached, either the numeric id only or, if a pattern is given,
the pattern and the associated PID
@param pOpts options from where to take the PID or pattern
@param pHandler handler for looking up the process in case of a pattern lookup
@return a description of the process | [
"Get",
"a",
"description",
"of",
"the",
"process",
"attached",
"either",
"the",
"numeric",
"id",
"only",
"or",
"if",
"a",
"pattern",
"is",
"given",
"the",
"pattern",
"and",
"the",
"associated",
"PID"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/command/AbstractBaseCommand.java#L127-L149 |
120,313 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java | JolokiaServer.start | public void start() {
// URL as configured takes precedence
String configUrl = NetworkUtil.replaceExpression(config.getJolokiaConfig().get(ConfigKey.DISCOVERY_AGENT_URL));
jolokiaHttpHandler.start(lazy,configUrl != null ? configUrl : url, config.getAuthenticator() != null);
if (httpServ... | java | public void start() {
// URL as configured takes precedence
String configUrl = NetworkUtil.replaceExpression(config.getJolokiaConfig().get(ConfigKey.DISCOVERY_AGENT_URL));
jolokiaHttpHandler.start(lazy,configUrl != null ? configUrl : url, config.getAuthenticator() != null);
if (httpServ... | [
"public",
"void",
"start",
"(",
")",
"{",
"// URL as configured takes precedence",
"String",
"configUrl",
"=",
"NetworkUtil",
".",
"replaceExpression",
"(",
"config",
".",
"getJolokiaConfig",
"(",
")",
".",
"get",
"(",
"ConfigKey",
".",
"DISCOVERY_AGENT_URL",
")",
... | Start this server. If we manage an own HttpServer, then the HttpServer will
be started as well. | [
"Start",
"this",
"server",
".",
"If",
"we",
"manage",
"an",
"own",
"HttpServer",
"then",
"the",
"HttpServer",
"will",
"be",
"started",
"as",
"well",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java#L104-L125 |
120,314 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java | JolokiaServer.init | protected final void init(JolokiaServerConfig pConfig, boolean pLazy) throws IOException {
// We manage it on our own
httpServer = createHttpServer(pConfig);
init(httpServer, pConfig, pLazy);
} | java | protected final void init(JolokiaServerConfig pConfig, boolean pLazy) throws IOException {
// We manage it on our own
httpServer = createHttpServer(pConfig);
init(httpServer, pConfig, pLazy);
} | [
"protected",
"final",
"void",
"init",
"(",
"JolokiaServerConfig",
"pConfig",
",",
"boolean",
"pLazy",
")",
"throws",
"IOException",
"{",
"// We manage it on our own",
"httpServer",
"=",
"createHttpServer",
"(",
"pConfig",
")",
";",
"init",
"(",
"httpServer",
",",
... | Initialize this JolokiaServer and use an own created HttpServer
@param pConfig configuartion to use
@param pLazy whether to do the inialization lazy or not
@throws IOException if the creation of the HttpServer fails | [
"Initialize",
"this",
"JolokiaServer",
"and",
"use",
"an",
"own",
"created",
"HttpServer"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java#L165-L169 |
120,315 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java | JolokiaServer.createHttpServer | private HttpServer createHttpServer(JolokiaServerConfig pConfig) throws IOException {
int port = pConfig.getPort();
InetAddress address = pConfig.getAddress();
InetSocketAddress socketAddress = new InetSocketAddress(address,port);
HttpServer server = pConfig.useHttps() ?
... | java | private HttpServer createHttpServer(JolokiaServerConfig pConfig) throws IOException {
int port = pConfig.getPort();
InetAddress address = pConfig.getAddress();
InetSocketAddress socketAddress = new InetSocketAddress(address,port);
HttpServer server = pConfig.useHttps() ?
... | [
"private",
"HttpServer",
"createHttpServer",
"(",
"JolokiaServerConfig",
"pConfig",
")",
"throws",
"IOException",
"{",
"int",
"port",
"=",
"pConfig",
".",
"getPort",
"(",
")",
";",
"InetAddress",
"address",
"=",
"pConfig",
".",
"getAddress",
"(",
")",
";",
"In... | Create the HttpServer to use. Can be overridden if a custom or already existing HttpServer should be
used
@return HttpServer to use
@throws IOException if something fails during the initialisation | [
"Create",
"the",
"HttpServer",
"to",
"use",
".",
"Can",
"be",
"overridden",
"if",
"a",
"custom",
"or",
"already",
"existing",
"HttpServer",
"should",
"be",
"used"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaServer.java#L231-L255 |
120,316 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/list/MBeanInfoData.java | MBeanInfoData.addException | private void addException(ObjectName pName, Exception pExp) {
JSONObject mBeansMap = getOrCreateJSONObject(infoMap, pName.getDomain());
JSONObject mBeanMap = getOrCreateJSONObject(mBeansMap, getKeyPropertyString(pName));
mBeanMap.put(DataKeys.ERROR.getKey(), pExp.toString());
} | java | private void addException(ObjectName pName, Exception pExp) {
JSONObject mBeansMap = getOrCreateJSONObject(infoMap, pName.getDomain());
JSONObject mBeanMap = getOrCreateJSONObject(mBeansMap, getKeyPropertyString(pName));
mBeanMap.put(DataKeys.ERROR.getKey(), pExp.toString());
} | [
"private",
"void",
"addException",
"(",
"ObjectName",
"pName",
",",
"Exception",
"pExp",
")",
"{",
"JSONObject",
"mBeansMap",
"=",
"getOrCreateJSONObject",
"(",
"infoMap",
",",
"pName",
".",
"getDomain",
"(",
")",
")",
";",
"JSONObject",
"mBeanMap",
"=",
"getO... | Add an exception to the info map | [
"Add",
"an",
"exception",
"to",
"the",
"info",
"map"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/list/MBeanInfoData.java#L248-L252 |
120,317 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/list/MBeanInfoData.java | MBeanInfoData.truncatePathStack | private Stack<String> truncatePathStack(int pLevel) {
if (pathStack.size() < pLevel) {
return new Stack<String>();
} else {
// Trim of domain and MBean properties
// pathStack gets cloned here since the processing will eat it up
Stack<String> ret = (Stack<... | java | private Stack<String> truncatePathStack(int pLevel) {
if (pathStack.size() < pLevel) {
return new Stack<String>();
} else {
// Trim of domain and MBean properties
// pathStack gets cloned here since the processing will eat it up
Stack<String> ret = (Stack<... | [
"private",
"Stack",
"<",
"String",
">",
"truncatePathStack",
"(",
"int",
"pLevel",
")",
"{",
"if",
"(",
"pathStack",
".",
"size",
"(",
")",
"<",
"pLevel",
")",
"{",
"return",
"new",
"Stack",
"<",
"String",
">",
"(",
")",
";",
"}",
"else",
"{",
"// ... | Trim down the stack by some value or return an empty stack | [
"Trim",
"down",
"the",
"stack",
"by",
"some",
"value",
"or",
"return",
"an",
"empty",
"stack"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/list/MBeanInfoData.java#L321-L333 |
120,318 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/list/MBeanInfoData.java | MBeanInfoData.navigatePath | private Object navigatePath() {
int size = pathStack.size();
JSONObject innerMap = infoMap;
while (size > 0) {
Collection vals = innerMap.values();
if (vals.size() == 0) {
return innerMap;
} else if (vals.size() != 1) {
throw n... | java | private Object navigatePath() {
int size = pathStack.size();
JSONObject innerMap = infoMap;
while (size > 0) {
Collection vals = innerMap.values();
if (vals.size() == 0) {
return innerMap;
} else if (vals.size() != 1) {
throw n... | [
"private",
"Object",
"navigatePath",
"(",
")",
"{",
"int",
"size",
"=",
"pathStack",
".",
"size",
"(",
")",
";",
"JSONObject",
"innerMap",
"=",
"infoMap",
";",
"while",
"(",
"size",
">",
"0",
")",
"{",
"Collection",
"vals",
"=",
"innerMap",
".",
"value... | Navigate to sub map or leaf value | [
"Navigate",
"to",
"sub",
"map",
"or",
"leaf",
"value"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/list/MBeanInfoData.java#L336-L361 |
120,319 | rhuss/jolokia | agent/mule/src/main/java/org/jolokia/mule/EclipseMuleAgentHttpServer.java | EclipseMuleAgentHttpServer.getServer | protected Server getServer(MuleAgentConfig pConfig) {
Server newServer = new Server();
Connector connector = createConnector(newServer);
if (pConfig.getHost() != null) {
ClassUtil.applyMethod(connector, "setHost", pConfig.getHost());
}
ClassUtil.applyMethod(connector... | java | protected Server getServer(MuleAgentConfig pConfig) {
Server newServer = new Server();
Connector connector = createConnector(newServer);
if (pConfig.getHost() != null) {
ClassUtil.applyMethod(connector, "setHost", pConfig.getHost());
}
ClassUtil.applyMethod(connector... | [
"protected",
"Server",
"getServer",
"(",
"MuleAgentConfig",
"pConfig",
")",
"{",
"Server",
"newServer",
"=",
"new",
"Server",
"(",
")",
";",
"Connector",
"connector",
"=",
"createConnector",
"(",
"newServer",
")",
";",
"if",
"(",
"pConfig",
".",
"getHost",
"... | Get the agent server for suing it with mule
@param pConfig agent configuration
@return the server | [
"Get",
"the",
"agent",
"server",
"for",
"suing",
"it",
"with",
"mule"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/mule/src/main/java/org/jolokia/mule/EclipseMuleAgentHttpServer.java#L99-L110 |
120,320 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/discovery/AgentDetails.java | AgentDetails.setServerInfo | public void setServerInfo(String pVendor, String pProduct, String pVersion) {
checkSeal();
serverVendor = pVendor;
serverProduct = pProduct;
serverVersion = pVersion;
} | java | public void setServerInfo(String pVendor, String pProduct, String pVersion) {
checkSeal();
serverVendor = pVendor;
serverProduct = pProduct;
serverVersion = pVersion;
} | [
"public",
"void",
"setServerInfo",
"(",
"String",
"pVendor",
",",
"String",
"pProduct",
",",
"String",
"pVersion",
")",
"{",
"checkSeal",
"(",
")",
";",
"serverVendor",
"=",
"pVendor",
";",
"serverProduct",
"=",
"pProduct",
";",
"serverVersion",
"=",
"pVersion... | Single method for updating the server information when the server has been detected
@param pVendor vendor of the deteted container
@param pProduct name of the contained
@param pVersion server version (not Jolokia's version!) | [
"Single",
"method",
"for",
"updating",
"the",
"server",
"information",
"when",
"the",
"server",
"has",
"been",
"detected"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/AgentDetails.java#L90-L95 |
120,321 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/discovery/AgentDetails.java | AgentDetails.toJSONObject | public JSONObject toJSONObject() {
JSONObject resp = new JSONObject();
add(resp, URL,url);
if (secured != null) {
add(resp, SECURED, secured);
}
add(resp, SERVER_VENDOR, serverVendor);
add(resp, SERVER_PRODUCT, serverProduct);
add(resp, SERVER_VERSION,... | java | public JSONObject toJSONObject() {
JSONObject resp = new JSONObject();
add(resp, URL,url);
if (secured != null) {
add(resp, SECURED, secured);
}
add(resp, SERVER_VENDOR, serverVendor);
add(resp, SERVER_PRODUCT, serverProduct);
add(resp, SERVER_VERSION,... | [
"public",
"JSONObject",
"toJSONObject",
"(",
")",
"{",
"JSONObject",
"resp",
"=",
"new",
"JSONObject",
"(",
")",
";",
"add",
"(",
"resp",
",",
"URL",
",",
"url",
")",
";",
"if",
"(",
"secured",
"!=",
"null",
")",
"{",
"add",
"(",
"resp",
",",
"SECU... | Get the details as JSON Object
@return | [
"Get",
"the",
"details",
"as",
"JSON",
"Object"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/discovery/AgentDetails.java#L149-L162 |
120,322 | rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/security/MultiAuthenticator.java | MultiAuthenticator.authenticate | @Override
public Result authenticate(HttpExchange httpExchange) {
Result result = null;
for (Authenticator a : authenticators) {
result = a.authenticate(httpExchange);
if ((result instanceof Success && mode == Mode.ANY) ||
(!(result instanceof Success) && mode... | java | @Override
public Result authenticate(HttpExchange httpExchange) {
Result result = null;
for (Authenticator a : authenticators) {
result = a.authenticate(httpExchange);
if ((result instanceof Success && mode == Mode.ANY) ||
(!(result instanceof Success) && mode... | [
"@",
"Override",
"public",
"Result",
"authenticate",
"(",
"HttpExchange",
"httpExchange",
")",
"{",
"Result",
"result",
"=",
"null",
";",
"for",
"(",
"Authenticator",
"a",
":",
"authenticators",
")",
"{",
"result",
"=",
"a",
".",
"authenticate",
"(",
"httpEx... | Authenticate against the given request
@param httpExchange request and response object
@return the result of the first authenticator that does succeed, or the last failure result. | [
"Authenticate",
"against",
"the",
"given",
"request"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/security/MultiAuthenticator.java#L85-L97 |
120,323 | rhuss/jolokia | client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java | J4pRequestHandler.getHttpRequest | public HttpUriRequest getHttpRequest(J4pRequest pRequest, String pPreferredMethod,
Map<J4pQueryParameter, String> pProcessingOptions) throws UnsupportedEncodingException, URISyntaxException {
String method = pPreferredMethod;
if (method == null) {
met... | java | public HttpUriRequest getHttpRequest(J4pRequest pRequest, String pPreferredMethod,
Map<J4pQueryParameter, String> pProcessingOptions) throws UnsupportedEncodingException, URISyntaxException {
String method = pPreferredMethod;
if (method == null) {
met... | [
"public",
"HttpUriRequest",
"getHttpRequest",
"(",
"J4pRequest",
"pRequest",
",",
"String",
"pPreferredMethod",
",",
"Map",
"<",
"J4pQueryParameter",
",",
"String",
">",
"pProcessingOptions",
")",
"throws",
"UnsupportedEncodingException",
",",
"URISyntaxException",
"{",
... | Get the HttpRequest for executing the given single request
@param pRequest request to convert
@param pPreferredMethod HTTP method preferred
@param pProcessingOptions optional map of processiong options
@return the request used with HttpClient to obtain the result. | [
"Get",
"the",
"HttpRequest",
"for",
"executing",
"the",
"given",
"single",
"request"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java#L73-L108 |
120,324 | rhuss/jolokia | client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java | J4pRequestHandler.getHttpRequest | public <T extends J4pRequest> HttpUriRequest getHttpRequest(List<T> pRequests,Map<J4pQueryParameter,String> pProcessingOptions)
throws UnsupportedEncodingException, URISyntaxException {
JSONArray bulkRequest = new JSONArray();
String queryParams = prepareQueryParameters(pProcessingOptions);
... | java | public <T extends J4pRequest> HttpUriRequest getHttpRequest(List<T> pRequests,Map<J4pQueryParameter,String> pProcessingOptions)
throws UnsupportedEncodingException, URISyntaxException {
JSONArray bulkRequest = new JSONArray();
String queryParams = prepareQueryParameters(pProcessingOptions);
... | [
"public",
"<",
"T",
"extends",
"J4pRequest",
">",
"HttpUriRequest",
"getHttpRequest",
"(",
"List",
"<",
"T",
">",
"pRequests",
",",
"Map",
"<",
"J4pQueryParameter",
",",
"String",
">",
"pProcessingOptions",
")",
"throws",
"UnsupportedEncodingException",
",",
"URIS... | Get an HTTP Request for requesting multiples requests at once
@param pRequests requests to put into a HTTP request
@return HTTP request to send to the server | [
"Get",
"an",
"HTTP",
"Request",
"for",
"requesting",
"multiples",
"requests",
"at",
"once"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java#L132-L143 |
120,325 | rhuss/jolokia | client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java | J4pRequestHandler.extractJsonResponse | @SuppressWarnings("PMD.PreserveStackTrace")
public JSONAware extractJsonResponse(HttpResponse pHttpResponse) throws IOException, ParseException {
HttpEntity entity = pHttpResponse.getEntity();
try {
JSONParser parser = new JSONParser();
Header contentEncoding = entity.getCont... | java | @SuppressWarnings("PMD.PreserveStackTrace")
public JSONAware extractJsonResponse(HttpResponse pHttpResponse) throws IOException, ParseException {
HttpEntity entity = pHttpResponse.getEntity();
try {
JSONParser parser = new JSONParser();
Header contentEncoding = entity.getCont... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.PreserveStackTrace\"",
")",
"public",
"JSONAware",
"extractJsonResponse",
"(",
"HttpResponse",
"pHttpResponse",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"HttpEntity",
"entity",
"=",
"pHttpResponse",
".",
"getEntity",
... | Extract the complete JSON response out of a HTTP response
@param pHttpResponse the resulting http response
@return JSON content of the answer | [
"Extract",
"the",
"complete",
"JSON",
"response",
"out",
"of",
"a",
"HTTP",
"response"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java#L152-L168 |
120,326 | rhuss/jolokia | client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java | J4pRequestHandler.createRequestURI | private URI createRequestURI(String path,String queryParams) throws URISyntaxException {
return new URI(j4pServerUrl.getScheme(),
j4pServerUrl.getUserInfo(),
j4pServerUrl.getHost(),
j4pServerUrl.getPort(),
... | java | private URI createRequestURI(String path,String queryParams) throws URISyntaxException {
return new URI(j4pServerUrl.getScheme(),
j4pServerUrl.getUserInfo(),
j4pServerUrl.getHost(),
j4pServerUrl.getPort(),
... | [
"private",
"URI",
"createRequestURI",
"(",
"String",
"path",
",",
"String",
"queryParams",
")",
"throws",
"URISyntaxException",
"{",
"return",
"new",
"URI",
"(",
"j4pServerUrl",
".",
"getScheme",
"(",
")",
",",
"j4pServerUrl",
".",
"getUserInfo",
"(",
")",
","... | Create the request URI to use | [
"Create",
"the",
"request",
"URI",
"to",
"use"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java#L198-L205 |
120,327 | rhuss/jolokia | client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java | J4pRequestHandler.prepareQueryParameters | private String prepareQueryParameters(Map<J4pQueryParameter, String> pProcessingOptions) {
if (pProcessingOptions != null && pProcessingOptions.size() > 0) {
StringBuilder queryParams = new StringBuilder();
for (Map.Entry<J4pQueryParameter,String> entry : pProcessingOptions.entrySet()) {... | java | private String prepareQueryParameters(Map<J4pQueryParameter, String> pProcessingOptions) {
if (pProcessingOptions != null && pProcessingOptions.size() > 0) {
StringBuilder queryParams = new StringBuilder();
for (Map.Entry<J4pQueryParameter,String> entry : pProcessingOptions.entrySet()) {... | [
"private",
"String",
"prepareQueryParameters",
"(",
"Map",
"<",
"J4pQueryParameter",
",",
"String",
">",
"pProcessingOptions",
")",
"{",
"if",
"(",
"pProcessingOptions",
"!=",
"null",
"&&",
"pProcessingOptions",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"Stri... | prepare query parameters | [
"prepare",
"query",
"parameters"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/client/java/src/main/java/org/jolokia/client/request/J4pRequestHandler.java#L208-L218 |
120,328 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java | JsonRequestHandler.checkHttpMethod | private void checkHttpMethod(R pRequest) {
if (!restrictor.isHttpMethodAllowed(pRequest.getHttpMethod())) {
throw new SecurityException("HTTP method " + pRequest.getHttpMethod().getMethod() +
" is not allowed according to the installed security policy");
}
} | java | private void checkHttpMethod(R pRequest) {
if (!restrictor.isHttpMethodAllowed(pRequest.getHttpMethod())) {
throw new SecurityException("HTTP method " + pRequest.getHttpMethod().getMethod() +
" is not allowed according to the installed security policy");
}
} | [
"private",
"void",
"checkHttpMethod",
"(",
"R",
"pRequest",
")",
"{",
"if",
"(",
"!",
"restrictor",
".",
"isHttpMethodAllowed",
"(",
"pRequest",
".",
"getHttpMethod",
"(",
")",
")",
")",
"{",
"throw",
"new",
"SecurityException",
"(",
"\"HTTP method \"",
"+",
... | Check whether the HTTP method with which the request was sent is allowed according to the policy
installed
@param pRequest request to check | [
"Check",
"whether",
"the",
"HTTP",
"method",
"with",
"which",
"the",
"request",
"was",
"sent",
"is",
"allowed",
"according",
"to",
"the",
"policy",
"installed"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java#L117-L122 |
120,329 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java | JsonRequestHandler.checkForModifiedSince | protected void checkForModifiedSince(MBeanServerExecutor pServerManager, JmxRequest pRequest)
throws NotChangedException {
int ifModifiedSince = pRequest.getParameterAsInt(ConfigKey.IF_MODIFIED_SINCE);
if (!pServerManager.hasMBeansListChangedSince(ifModifiedSince)) {
throw new No... | java | protected void checkForModifiedSince(MBeanServerExecutor pServerManager, JmxRequest pRequest)
throws NotChangedException {
int ifModifiedSince = pRequest.getParameterAsInt(ConfigKey.IF_MODIFIED_SINCE);
if (!pServerManager.hasMBeansListChangedSince(ifModifiedSince)) {
throw new No... | [
"protected",
"void",
"checkForModifiedSince",
"(",
"MBeanServerExecutor",
"pServerManager",
",",
"JmxRequest",
"pRequest",
")",
"throws",
"NotChangedException",
"{",
"int",
"ifModifiedSince",
"=",
"pRequest",
".",
"getParameterAsInt",
"(",
"ConfigKey",
".",
"IF_MODIFIED_S... | Check, whether the set of MBeans for any managed MBeanServer has been change since the timestamp
provided in the given request
@param pServerManager manager for all MBeanServers
@param pRequest the request from where to fetch the timestamp
@throws NotChangedException if there has been no REGISTER/UNREGISTER notificatio... | [
"Check",
"whether",
"the",
"set",
"of",
"MBeans",
"for",
"any",
"managed",
"MBeanServer",
"has",
"been",
"change",
"since",
"the",
"timestamp",
"provided",
"in",
"the",
"given",
"request"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/JsonRequestHandler.java#L208-L214 |
120,330 | rhuss/jolokia | agent/mule/src/main/java/org/jolokia/mule/MortbayMuleAgentHttpServer.java | MortbayMuleAgentHttpServer.getServer | private Server getServer(MuleAgentConfig pConfig) {
Server newServer = new Server();
Connector connector = new SelectChannelConnector();
if (pConfig.getHost() != null) {
connector.setHost(pConfig.getHost());
}
connector.setPort(pConfig.getPort());
newServer.s... | java | private Server getServer(MuleAgentConfig pConfig) {
Server newServer = new Server();
Connector connector = new SelectChannelConnector();
if (pConfig.getHost() != null) {
connector.setHost(pConfig.getHost());
}
connector.setPort(pConfig.getPort());
newServer.s... | [
"private",
"Server",
"getServer",
"(",
"MuleAgentConfig",
"pConfig",
")",
"{",
"Server",
"newServer",
"=",
"new",
"Server",
"(",
")",
";",
"Connector",
"connector",
"=",
"new",
"SelectChannelConnector",
"(",
")",
";",
"if",
"(",
"pConfig",
".",
"getHost",
"(... | Create a Jetty Server with the agent servlet installed | [
"Create",
"a",
"Jetty",
"Server",
"with",
"the",
"agent",
"servlet",
"installed"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/mule/src/main/java/org/jolokia/mule/MortbayMuleAgentHttpServer.java#L94-L105 |
120,331 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/WeblogicDetector.java | WeblogicDetector.addMBeanServers | @Override
public void addMBeanServers(Set<MBeanServerConnection> servers) {
// Weblogic stores the MBeanServer in a JNDI context
// Workaround for broken JBoss 4.2.3 which doesn't like JNDI lookups. See #123 for details.
if (!isJBoss()) {
InitialContext ctx;
try {
... | java | @Override
public void addMBeanServers(Set<MBeanServerConnection> servers) {
// Weblogic stores the MBeanServer in a JNDI context
// Workaround for broken JBoss 4.2.3 which doesn't like JNDI lookups. See #123 for details.
if (!isJBoss()) {
InitialContext ctx;
try {
... | [
"@",
"Override",
"public",
"void",
"addMBeanServers",
"(",
"Set",
"<",
"MBeanServerConnection",
">",
"servers",
")",
"{",
"// Weblogic stores the MBeanServer in a JNDI context",
"// Workaround for broken JBoss 4.2.3 which doesn't like JNDI lookups. See #123 for details.",
"if",
"(",
... | Adde Weblogic specific runtime MBeanServer
@param servers set to add own MBean servers | [
"Adde",
"Weblogic",
"specific",
"runtime",
"MBeanServer"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/WeblogicDetector.java#L51-L68 |
120,332 | rhuss/jolokia | agent/mule/src/main/java/org/jolokia/mule/JolokiaMuleAgent.java | JolokiaMuleAgent.getDescription | @Override
public String getDescription() {
String hostDescr = host;
try {
if (hostDescr == null) {
hostDescr = NetworkUtil.getLocalAddress().getHostName();
}
} catch (IOException e) {
hostDescr = "localhost";
}
return "Jolok... | java | @Override
public String getDescription() {
String hostDescr = host;
try {
if (hostDescr == null) {
hostDescr = NetworkUtil.getLocalAddress().getHostName();
}
} catch (IOException e) {
hostDescr = "localhost";
}
return "Jolok... | [
"@",
"Override",
"public",
"String",
"getDescription",
"(",
")",
"{",
"String",
"hostDescr",
"=",
"host",
";",
"try",
"{",
"if",
"(",
"hostDescr",
"==",
"null",
")",
"{",
"hostDescr",
"=",
"NetworkUtil",
".",
"getLocalAddress",
"(",
")",
".",
"getHostName"... | Description including agent URL
@return agent url | [
"Description",
"including",
"agent",
"URL"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/mule/src/main/java/org/jolokia/mule/JolokiaMuleAgent.java#L79-L90 |
120,333 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServerUtil.java | JolokiaMBeanServerUtil.getJolokiaMBeanServer | public static MBeanServer getJolokiaMBeanServer() {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
MBeanServer jolokiaMBeanServer;
try {
jolokiaMBeanServer =
(MBeanServer) server.getAttribute(createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_... | java | public static MBeanServer getJolokiaMBeanServer() {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
MBeanServer jolokiaMBeanServer;
try {
jolokiaMBeanServer =
(MBeanServer) server.getAttribute(createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_... | [
"public",
"static",
"MBeanServer",
"getJolokiaMBeanServer",
"(",
")",
"{",
"MBeanServer",
"server",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"MBeanServer",
"jolokiaMBeanServer",
";",
"try",
"{",
"jolokiaMBeanServer",
"=",
"(",
"MBeanServ... | Lookup the JolokiaMBean server via a JMX lookup to the Jolokia-internal MBean exposing this MBeanServer
@return the Jolokia MBeanServer or null if not yet available present | [
"Lookup",
"the",
"JolokiaMBean",
"server",
"via",
"a",
"JMX",
"lookup",
"to",
"the",
"Jolokia",
"-",
"internal",
"MBean",
"exposing",
"this",
"MBeanServer"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServerUtil.java#L42-L58 |
120,334 | rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServerUtil.java | JolokiaMBeanServerUtil.registerJolokiaMBeanServerHolderMBean | static MBeanServer registerJolokiaMBeanServerHolderMBean(MBeanServer pServer) {
JolokiaMBeanServerHolder holder = new JolokiaMBeanServerHolder();
ObjectName holderName = createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_NAME);
MBeanServer jolokiaMBeanServer;
try {
pServer... | java | static MBeanServer registerJolokiaMBeanServerHolderMBean(MBeanServer pServer) {
JolokiaMBeanServerHolder holder = new JolokiaMBeanServerHolder();
ObjectName holderName = createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_NAME);
MBeanServer jolokiaMBeanServer;
try {
pServer... | [
"static",
"MBeanServer",
"registerJolokiaMBeanServerHolderMBean",
"(",
"MBeanServer",
"pServer",
")",
"{",
"JolokiaMBeanServerHolder",
"holder",
"=",
"new",
"JolokiaMBeanServerHolder",
"(",
")",
";",
"ObjectName",
"holderName",
"=",
"createObjectName",
"(",
"JolokiaMBeanSer... | package visible for unit testing | [
"package",
"visible",
"for",
"unit",
"testing"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServerUtil.java#L91-L111 |
120,335 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/ExecHandler.java | ExecHandler.verifyArguments | private void verifyArguments(JmxExecRequest request, OperationAndParamType pTypes, int pNrParams, List<Object> pArgs) {
if ( (pNrParams > 0 && pArgs == null) || (pArgs != null && pArgs.size() != pNrParams)) {
throw new IllegalArgumentException("Invalid number of operation arguments. Operation " +
... | java | private void verifyArguments(JmxExecRequest request, OperationAndParamType pTypes, int pNrParams, List<Object> pArgs) {
if ( (pNrParams > 0 && pArgs == null) || (pArgs != null && pArgs.size() != pNrParams)) {
throw new IllegalArgumentException("Invalid number of operation arguments. Operation " +
... | [
"private",
"void",
"verifyArguments",
"(",
"JmxExecRequest",
"request",
",",
"OperationAndParamType",
"pTypes",
",",
"int",
"pNrParams",
",",
"List",
"<",
"Object",
">",
"pArgs",
")",
"{",
"if",
"(",
"(",
"pNrParams",
">",
"0",
"&&",
"pArgs",
"==",
"null",
... | check whether the given arguments are compatible with the signature and if not so, raise an excepton | [
"check",
"whether",
"the",
"given",
"arguments",
"are",
"compatible",
"with",
"the",
"signature",
"and",
"if",
"not",
"so",
"raise",
"an",
"excepton"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/ExecHandler.java#L102-L108 |
120,336 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/ExecHandler.java | ExecHandler.extractOperationTypes | private OperationAndParamType extractOperationTypes(MBeanServerConnection pServer, JmxExecRequest pRequest)
throws ReflectionException, InstanceNotFoundException, IOException {
if (pRequest.getOperation() == null) {
throw new IllegalArgumentException("No operation given for exec Request ... | java | private OperationAndParamType extractOperationTypes(MBeanServerConnection pServer, JmxExecRequest pRequest)
throws ReflectionException, InstanceNotFoundException, IOException {
if (pRequest.getOperation() == null) {
throw new IllegalArgumentException("No operation given for exec Request ... | [
"private",
"OperationAndParamType",
"extractOperationTypes",
"(",
"MBeanServerConnection",
"pServer",
",",
"JmxExecRequest",
"pRequest",
")",
"throws",
"ReflectionException",
",",
"InstanceNotFoundException",
",",
"IOException",
"{",
"if",
"(",
"pRequest",
".",
"getOperatio... | Extract the operation and type list from a given request
@param pServer server from which obtain the MBean type info
@param pRequest the exec request
@return combined object containing the operation name and parameter classes | [
"Extract",
"the",
"operation",
"and",
"type",
"list",
"from",
"a",
"given",
"request"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/ExecHandler.java#L117-L151 |
120,337 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/ExecHandler.java | ExecHandler.extractMBeanParameterInfos | private List<MBeanParameterInfo[]> extractMBeanParameterInfos(MBeanServerConnection pServer, JmxExecRequest pRequest,
String pOperation)
throws InstanceNotFoundException, ReflectionException, IOException {
try {
MBeanInfo ... | java | private List<MBeanParameterInfo[]> extractMBeanParameterInfos(MBeanServerConnection pServer, JmxExecRequest pRequest,
String pOperation)
throws InstanceNotFoundException, ReflectionException, IOException {
try {
MBeanInfo ... | [
"private",
"List",
"<",
"MBeanParameterInfo",
"[",
"]",
">",
"extractMBeanParameterInfos",
"(",
"MBeanServerConnection",
"pServer",
",",
"JmxExecRequest",
"pRequest",
",",
"String",
"pOperation",
")",
"throws",
"InstanceNotFoundException",
",",
"ReflectionException",
",",... | Extract a list of operation signatures which match a certain operation name. The returned list
can contain multiple signature in case of overloaded JMX operations.
@param pServer server from where to fetch the MBean info for a given request's object name
@param pRequest the JMX request
@param pOperation the operation ... | [
"Extract",
"a",
"list",
"of",
"operation",
"signatures",
"which",
"match",
"a",
"certain",
"operation",
"name",
".",
"The",
"returned",
"list",
"can",
"contain",
"multiple",
"signature",
"in",
"case",
"of",
"overloaded",
"JMX",
"operations",
"."
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/ExecHandler.java#L163-L182 |
120,338 | rhuss/jolokia | agent/core/src/main/java/org/jolokia/handler/ExecHandler.java | ExecHandler.splitOperation | private List<String> splitOperation(String pOperation) {
List<String> ret = new ArrayList<String>();
Pattern p = Pattern.compile("^(.*)\\((.*)\\)$");
Matcher m = p.matcher(pOperation);
if (m.matches()) {
ret.add(m.group(1));
if (m.group(2).length() > 0) {
... | java | private List<String> splitOperation(String pOperation) {
List<String> ret = new ArrayList<String>();
Pattern p = Pattern.compile("^(.*)\\((.*)\\)$");
Matcher m = p.matcher(pOperation);
if (m.matches()) {
ret.add(m.group(1));
if (m.group(2).length() > 0) {
... | [
"private",
"List",
"<",
"String",
">",
"splitOperation",
"(",
"String",
"pOperation",
")",
"{",
"List",
"<",
"String",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"\"^(.*)... | Extract operation and optional type parameters | [
"Extract",
"operation",
"and",
"optional",
"type",
"parameters"
] | dc95e7bef859b1829776c5a84c8f7738f5d7d9c3 | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/handler/ExecHandler.java#L217-L236 |
120,339 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/AbstractImmutableSubstitutionImpl.java | AbstractImmutableSubstitutionImpl.composeWith | @Override
public ImmutableSubstitution<ImmutableTerm> composeWith(ImmutableSubstitution<? extends ImmutableTerm> f) {
if (isEmpty()) {
return (ImmutableSubstitution<ImmutableTerm>)f;
}
if (f.isEmpty()) {
return (ImmutableSubstitution<ImmutableTerm>)this;
}
... | java | @Override
public ImmutableSubstitution<ImmutableTerm> composeWith(ImmutableSubstitution<? extends ImmutableTerm> f) {
if (isEmpty()) {
return (ImmutableSubstitution<ImmutableTerm>)f;
}
if (f.isEmpty()) {
return (ImmutableSubstitution<ImmutableTerm>)this;
}
... | [
"@",
"Override",
"public",
"ImmutableSubstitution",
"<",
"ImmutableTerm",
">",
"composeWith",
"(",
"ImmutableSubstitution",
"<",
"?",
"extends",
"ImmutableTerm",
">",
"f",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"(",
"ImmutableSubstitution"... | " "this o f"
Equivalent to the function x -> this.apply(f.apply(x))
Follows the formal definition of a the composition of two substitutions. | [
"this",
"o",
"f"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/AbstractImmutableSubstitutionImpl.java#L133-L169 |
120,340 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/AbstractImmutableSubstitutionImpl.java | AbstractImmutableSubstitutionImpl.computeUnionMap | protected Optional<ImmutableMap<Variable, T>> computeUnionMap(ImmutableSubstitution<T> otherSubstitution) {
ImmutableMap.Builder<Variable, T> mapBuilder = ImmutableMap.builder();
mapBuilder.putAll(getImmutableMap());
ImmutableMap<Variable, T> otherMap = otherSubstitution.getImmutableMap();
... | java | protected Optional<ImmutableMap<Variable, T>> computeUnionMap(ImmutableSubstitution<T> otherSubstitution) {
ImmutableMap.Builder<Variable, T> mapBuilder = ImmutableMap.builder();
mapBuilder.putAll(getImmutableMap());
ImmutableMap<Variable, T> otherMap = otherSubstitution.getImmutableMap();
... | [
"protected",
"Optional",
"<",
"ImmutableMap",
"<",
"Variable",
",",
"T",
">",
">",
"computeUnionMap",
"(",
"ImmutableSubstitution",
"<",
"T",
">",
"otherSubstitution",
")",
"{",
"ImmutableMap",
".",
"Builder",
"<",
"Variable",
",",
"T",
">",
"mapBuilder",
"=",... | In case some sub-classes wants to add a new unionXX method returning an optional in their own type.
TODO: explain | [
"In",
"case",
"some",
"sub",
"-",
"classes",
"wants",
"to",
"add",
"a",
"new",
"unionXX",
"method",
"returning",
"an",
"optional",
"in",
"their",
"own",
"type",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/AbstractImmutableSubstitutionImpl.java#L181-L201 |
120,341 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/AbstractImmutableSubstitutionImpl.java | AbstractImmutableSubstitutionImpl.applyNullNormalization | private Map.Entry<Variable, ImmutableTerm> applyNullNormalization(
Map.Entry<Variable, ImmutableTerm> substitutionEntry) {
ImmutableTerm value = substitutionEntry.getValue();
if (value instanceof ImmutableFunctionalTerm) {
ImmutableTerm newValue = normalizeFunctionalTerm((Immutab... | java | private Map.Entry<Variable, ImmutableTerm> applyNullNormalization(
Map.Entry<Variable, ImmutableTerm> substitutionEntry) {
ImmutableTerm value = substitutionEntry.getValue();
if (value instanceof ImmutableFunctionalTerm) {
ImmutableTerm newValue = normalizeFunctionalTerm((Immutab... | [
"private",
"Map",
".",
"Entry",
"<",
"Variable",
",",
"ImmutableTerm",
">",
"applyNullNormalization",
"(",
"Map",
".",
"Entry",
"<",
"Variable",
",",
"ImmutableTerm",
">",
"substitutionEntry",
")",
"{",
"ImmutableTerm",
"value",
"=",
"substitutionEntry",
".",
"g... | Most functional terms do not accept NULL as arguments. If this happens, they become NULL. | [
"Most",
"functional",
"terms",
"do",
"not",
"accept",
"NULL",
"as",
"arguments",
".",
"If",
"this",
"happens",
"they",
"become",
"NULL",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/AbstractImmutableSubstitutionImpl.java#L358-L368 |
120,342 | ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/validation/impl/MappingOntologyComplianceValidatorImpl.java | MappingOntologyComplianceValidatorImpl.getPredicateIRI | private Optional<IRI> getPredicateIRI(DataRangeExpression expression) {
if (expression instanceof Datatype) {
return Optional.of(((Datatype) expression).getIRI());
}
if (expression instanceof DataPropertyRangeExpression) {
return Optional.of(((DataPropertyRangeExpression)... | java | private Optional<IRI> getPredicateIRI(DataRangeExpression expression) {
if (expression instanceof Datatype) {
return Optional.of(((Datatype) expression).getIRI());
}
if (expression instanceof DataPropertyRangeExpression) {
return Optional.of(((DataPropertyRangeExpression)... | [
"private",
"Optional",
"<",
"IRI",
">",
"getPredicateIRI",
"(",
"DataRangeExpression",
"expression",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"Datatype",
")",
"{",
"return",
"Optional",
".",
"of",
"(",
"(",
"(",
"Datatype",
")",
"expression",
")",
".... | if the answer is no, drop the Optional and throw an exception instead | [
"if",
"the",
"answer",
"is",
"no",
"drop",
"the",
"Optional",
"and",
"throw",
"an",
"exception",
"instead"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/validation/impl/MappingOntologyComplianceValidatorImpl.java#L349-L357 |
120,343 | ontop/ontop | db/rdb/src/main/java/it/unibz/inf/ontop/utils/LocalJDBCConnectionUtils.java | LocalJDBCConnectionUtils.createConnection | public static Connection createConnection(OntopSQLCredentialSettings settings) throws SQLException {
try {
// This should work in most cases (e.g. from CLI, Protege, or Jetty)
return DriverManager.getConnection(settings.getJdbcUrl(), settings.getJdbcUser(), settings.getJdbcPassword());
... | java | public static Connection createConnection(OntopSQLCredentialSettings settings) throws SQLException {
try {
// This should work in most cases (e.g. from CLI, Protege, or Jetty)
return DriverManager.getConnection(settings.getJdbcUrl(), settings.getJdbcUser(), settings.getJdbcPassword());
... | [
"public",
"static",
"Connection",
"createConnection",
"(",
"OntopSQLCredentialSettings",
"settings",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"// This should work in most cases (e.g. from CLI, Protege, or Jetty)",
"return",
"DriverManager",
".",
"getConnection",
"(",
"se... | Brings robustness to some Tomcat classloading issues. | [
"Brings",
"robustness",
"to",
"some",
"Tomcat",
"classloading",
"issues",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/db/rdb/src/main/java/it/unibz/inf/ontop/utils/LocalJDBCConnectionUtils.java#L14-L32 |
120,344 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/dbschema/DatabaseRelationDefinition.java | DatabaseRelationDefinition.addAttribute | public Attribute addAttribute(QuotedID id, int type, String typeName, boolean canNull) {
Attribute att = new Attribute(this, new QualifiedAttributeID(getID(), id),
attributes.size() + 1, type, typeName, canNull,
typeMapper.getTermType(type, typeName));
//check for duplicate names (put returns the previou... | java | public Attribute addAttribute(QuotedID id, int type, String typeName, boolean canNull) {
Attribute att = new Attribute(this, new QualifiedAttributeID(getID(), id),
attributes.size() + 1, type, typeName, canNull,
typeMapper.getTermType(type, typeName));
//check for duplicate names (put returns the previou... | [
"public",
"Attribute",
"addAttribute",
"(",
"QuotedID",
"id",
",",
"int",
"type",
",",
"String",
"typeName",
",",
"boolean",
"canNull",
")",
"{",
"Attribute",
"att",
"=",
"new",
"Attribute",
"(",
"this",
",",
"new",
"QualifiedAttributeID",
"(",
"getID",
"(",... | creates a new attribute
@param id
@param type
@param typeName
@param canNull | [
"creates",
"a",
"new",
"attribute"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/DatabaseRelationDefinition.java#L66-L78 |
120,345 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/dbschema/DatabaseRelationDefinition.java | DatabaseRelationDefinition.getAttribute | @Override
public Attribute getAttribute(int index) {
Attribute attribute = attributes.get(index - 1);
return attribute;
} | java | @Override
public Attribute getAttribute(int index) {
Attribute attribute = attributes.get(index - 1);
return attribute;
} | [
"@",
"Override",
"public",
"Attribute",
"getAttribute",
"(",
"int",
"index",
")",
"{",
"Attribute",
"attribute",
"=",
"attributes",
".",
"get",
"(",
"index",
"-",
"1",
")",
";",
"return",
"attribute",
";",
"}"
] | gets attribute with the specified position
@param index is position <em>starting at 1</em>
@return attribute at the position | [
"gets",
"attribute",
"with",
"the",
"specified",
"position"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/DatabaseRelationDefinition.java#L97-L101 |
120,346 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/IndempotentVar2VarSubstitutionImpl.java | IndempotentVar2VarSubstitutionImpl.isIndempotent | public static boolean isIndempotent(Map<Variable, Variable> substitutionMap) {
if (substitutionMap.isEmpty())
return true;
Set<Variable> valueSet = new HashSet<>(substitutionMap.values());
valueSet.retainAll(substitutionMap.entrySet());
return valueSet.isEmpty();
} | java | public static boolean isIndempotent(Map<Variable, Variable> substitutionMap) {
if (substitutionMap.isEmpty())
return true;
Set<Variable> valueSet = new HashSet<>(substitutionMap.values());
valueSet.retainAll(substitutionMap.entrySet());
return valueSet.isEmpty();
} | [
"public",
"static",
"boolean",
"isIndempotent",
"(",
"Map",
"<",
"Variable",
",",
"Variable",
">",
"substitutionMap",
")",
"{",
"if",
"(",
"substitutionMap",
".",
"isEmpty",
"(",
")",
")",
"return",
"true",
";",
"Set",
"<",
"Variable",
">",
"valueSet",
"="... | Returns true if there is common variables in the domain and the range of the substitution map. | [
"Returns",
"true",
"if",
"there",
"is",
"common",
"variables",
"in",
"the",
"domain",
"and",
"the",
"range",
"of",
"the",
"substitution",
"map",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/IndempotentVar2VarSubstitutionImpl.java#L29-L37 |
120,347 | ontop/ontop | engine/reformulation/core/src/main/java/it/unibz/inf/ontop/answering/reformulation/input/translation/impl/SparqlAlgebraToDatalogTranslator.java | SparqlAlgebraToDatalogTranslator.translate | public InternalSparqlQuery translate(ParsedQuery pq) throws OntopUnsupportedInputQueryException, OntopInvalidInputQueryException {
if (predicateIdx != 0 || !program.getRules().isEmpty())
throw new IllegalStateException("SparqlAlgebraToDatalogTranslator.translate can only be called once.");
Tuple... | java | public InternalSparqlQuery translate(ParsedQuery pq) throws OntopUnsupportedInputQueryException, OntopInvalidInputQueryException {
if (predicateIdx != 0 || !program.getRules().isEmpty())
throw new IllegalStateException("SparqlAlgebraToDatalogTranslator.translate can only be called once.");
Tuple... | [
"public",
"InternalSparqlQuery",
"translate",
"(",
"ParsedQuery",
"pq",
")",
"throws",
"OntopUnsupportedInputQueryException",
",",
"OntopInvalidInputQueryException",
"{",
"if",
"(",
"predicateIdx",
"!=",
"0",
"||",
"!",
"program",
".",
"getRules",
"(",
")",
".",
"is... | Translate a given SPARQL query object to datalog program.
IMPORTANT: this method should be called only once on each instance of the class
@pq SPARQL query object
@return our representation of the SPARQL query (as a datalog program)
TODO: return an IntermediateQuery instead! | [
"Translate",
"a",
"given",
"SPARQL",
"query",
"object",
"to",
"datalog",
"program",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/core/src/main/java/it/unibz/inf/ontop/answering/reformulation/input/translation/impl/SparqlAlgebraToDatalogTranslator.java#L124-L151 |
120,348 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryGroupTreeElement.java | QueryGroupTreeElement.removeQuery | public QueryTreeElement removeQuery(String query_id) {
for (QueryTreeElement query : queries) {
if (query.getID().equals(query_id)) {
queries.remove(query);
return query;
}
}
return null;
} | java | public QueryTreeElement removeQuery(String query_id) {
for (QueryTreeElement query : queries) {
if (query.getID().equals(query_id)) {
queries.remove(query);
return query;
}
}
return null;
} | [
"public",
"QueryTreeElement",
"removeQuery",
"(",
"String",
"query_id",
")",
"{",
"for",
"(",
"QueryTreeElement",
"query",
":",
"queries",
")",
"{",
"if",
"(",
"query",
".",
"getID",
"(",
")",
".",
"equals",
"(",
"query_id",
")",
")",
"{",
"queries",
"."... | Removes a query from the group and returns the removed query, or null if
the query was not found in this group. | [
"Removes",
"a",
"query",
"from",
"the",
"group",
"and",
"returns",
"the",
"removed",
"query",
"or",
"null",
"if",
"the",
"query",
"was",
"not",
"found",
"in",
"this",
"group",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryGroupTreeElement.java#L62-L70 |
120,349 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryGroupTreeElement.java | QueryGroupTreeElement.getQuery | public QueryTreeElement getQuery(String id) {
for (QueryTreeElement query : queries) {
if (query.getID().equals(id)) {
return query;
}
}
return null;
} | java | public QueryTreeElement getQuery(String id) {
for (QueryTreeElement query : queries) {
if (query.getID().equals(id)) {
return query;
}
}
return null;
} | [
"public",
"QueryTreeElement",
"getQuery",
"(",
"String",
"id",
")",
"{",
"for",
"(",
"QueryTreeElement",
"query",
":",
"queries",
")",
"{",
"if",
"(",
"query",
".",
"getID",
"(",
")",
".",
"equals",
"(",
"id",
")",
")",
"{",
"return",
"query",
";",
"... | Searches a specific query and returns the object query else returns null. | [
"Searches",
"a",
"specific",
"query",
"and",
"returns",
"the",
"object",
"query",
"else",
"returns",
"null",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryGroupTreeElement.java#L79-L86 |
120,350 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/iq/impl/tree/DefaultTree.java | DefaultTree.getParentTreeNode | private TreeNode getParentTreeNode(TreeNode child) {
TreeNode parentTreeNode = parentIndex.get(child);
if (parentTreeNode == null)
return null;
// Makes sure the parent node is still present in the tree
else if (contains(parentTreeNode.getQueryNode()))
return pa... | java | private TreeNode getParentTreeNode(TreeNode child) {
TreeNode parentTreeNode = parentIndex.get(child);
if (parentTreeNode == null)
return null;
// Makes sure the parent node is still present in the tree
else if (contains(parentTreeNode.getQueryNode()))
return pa... | [
"private",
"TreeNode",
"getParentTreeNode",
"(",
"TreeNode",
"child",
")",
"{",
"TreeNode",
"parentTreeNode",
"=",
"parentIndex",
".",
"get",
"(",
"child",
")",
";",
"if",
"(",
"parentTreeNode",
"==",
"null",
")",
"return",
"null",
";",
"// Makes sure the parent... | The returned value might be null.
The point of this structure is to enforce the use of a TreeNode as argument. | [
"The",
"returned",
"value",
"might",
"be",
"null",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/iq/impl/tree/DefaultTree.java#L506-L517 |
120,351 | ontop/ontop | binding/rdf4j/src/main/java/it/unibz/inf/ontop/rdf4j/query/impl/AbstractOntopQuery.java | AbstractOntopQuery.getQueryString | protected String getQueryString() {
if (bindings.size() == 0)
return queryString;
String qry = queryString;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
... | java | protected String getQueryString() {
if (bindings.size() == 0)
return queryString;
String qry = queryString;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
... | [
"protected",
"String",
"getQueryString",
"(",
")",
"{",
"if",
"(",
"bindings",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"queryString",
";",
"String",
"qry",
"=",
"queryString",
";",
"int",
"b",
"=",
"qry",
".",
"indexOf",
"(",
"'",
"'",
")",
... | all code below is copy-pasted from org.eclipse.rdf4j.repository.sparql.query.SPARQLOperation | [
"all",
"code",
"below",
"is",
"copy",
"-",
"pasted",
"from",
"org",
".",
"eclipse",
".",
"rdf4j",
".",
"repository",
".",
"sparql",
".",
"query",
".",
"SPARQLOperation"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/binding/rdf4j/src/main/java/it/unibz/inf/ontop/rdf4j/query/impl/AbstractOntopQuery.java#L113-L129 |
120,352 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getBooleanConditions | private Set<String> getBooleanConditions(List<Function> atoms, AliasIndex index) {
Set<String> conditions = new LinkedHashSet<>();
for (Function atom : atoms) {
if (atom.isOperation()) { // Boolean expression
if (atom.getFunctionSymbol() == ExpressionOperation.AND) {
// flatten ANDs
for (Term t : ... | java | private Set<String> getBooleanConditions(List<Function> atoms, AliasIndex index) {
Set<String> conditions = new LinkedHashSet<>();
for (Function atom : atoms) {
if (atom.isOperation()) { // Boolean expression
if (atom.getFunctionSymbol() == ExpressionOperation.AND) {
// flatten ANDs
for (Term t : ... | [
"private",
"Set",
"<",
"String",
">",
"getBooleanConditions",
"(",
"List",
"<",
"Function",
">",
"atoms",
",",
"AliasIndex",
"index",
")",
"{",
"Set",
"<",
"String",
">",
"conditions",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
"Functi... | Returns a string with boolean conditions formed with the boolean atoms
found in the atoms list. | [
"Returns",
"a",
"string",
"with",
"boolean",
"conditions",
"formed",
"with",
"the",
"boolean",
"atoms",
"found",
"in",
"the",
"atoms",
"list",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L591-L613 |
120,353 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getTableDefinitions | private String getTableDefinitions(List<Function> atoms,
AliasIndex index,
String JOIN_KEYWORD,
boolean parenthesis,
String indent) {
List<String> tables = getTableDefs(atoms, index, INDENT + indent);
switch (tables.size()) {
case 0:
throw new RuntimeException... | java | private String getTableDefinitions(List<Function> atoms,
AliasIndex index,
String JOIN_KEYWORD,
boolean parenthesis,
String indent) {
List<String> tables = getTableDefs(atoms, index, INDENT + indent);
switch (tables.size()) {
case 0:
throw new RuntimeException... | [
"private",
"String",
"getTableDefinitions",
"(",
"List",
"<",
"Function",
">",
"atoms",
",",
"AliasIndex",
"index",
",",
"String",
"JOIN_KEYWORD",
",",
"boolean",
"parenthesis",
",",
"String",
"indent",
")",
"{",
"List",
"<",
"String",
">",
"tables",
"=",
"g... | Returns the table definition for these atoms. By default, a list of atoms
represents JOIN or LEFT JOIN of all the atoms, left to right. All boolean
atoms in the list are considered conditions in the ON clause of the JOIN.
<p>
If the list is a LeftJoin, then it can only have 2 data atoms, and it HAS
to have 2 data atom... | [
"Returns",
"the",
"table",
"definition",
"for",
"these",
"atoms",
".",
"By",
"default",
"a",
"list",
"of",
"atoms",
"represents",
"JOIN",
"or",
"LEFT",
"JOIN",
"of",
"all",
"the",
"atoms",
"left",
"to",
"right",
".",
"All",
"boolean",
"atoms",
"in",
"the... | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L690-L735 |
120,354 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getTableDefinition | private String getTableDefinition(Function atom, AliasIndex index, String indent) {
if (atom.isAlgebraFunction()) {
Predicate functionSymbol = atom.getFunctionSymbol();
ImmutableList<Function> joinAtoms = convert(atom.getTerms());
if (functionSymbol.equals(datalogFactory.getSparqlJoinPredicate())) {
// ... | java | private String getTableDefinition(Function atom, AliasIndex index, String indent) {
if (atom.isAlgebraFunction()) {
Predicate functionSymbol = atom.getFunctionSymbol();
ImmutableList<Function> joinAtoms = convert(atom.getTerms());
if (functionSymbol.equals(datalogFactory.getSparqlJoinPredicate())) {
// ... | [
"private",
"String",
"getTableDefinition",
"(",
"Function",
"atom",
",",
"AliasIndex",
"index",
",",
"String",
"indent",
")",
"{",
"if",
"(",
"atom",
".",
"isAlgebraFunction",
"(",
")",
")",
"{",
"Predicate",
"functionSymbol",
"=",
"atom",
".",
"getFunctionSym... | Returns the table definition for the given atom. If the atom is a simple
table or view, then it returns the value as defined by the
AliasIndex. If the atom is a Join or Left Join, it will call
getTableDefinitions on the nested term list. | [
"Returns",
"the",
"table",
"definition",
"for",
"the",
"given",
"atom",
".",
"If",
"the",
"atom",
"is",
"a",
"simple",
"table",
"or",
"view",
"then",
"it",
"returns",
"the",
"value",
"as",
"defined",
"by",
"the",
"AliasIndex",
".",
"If",
"the",
"atom",
... | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L743-L769 |
120,355 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getDataType | private int getDataType(Term term) {
/*
* TODO: refactor!
*/
if (term instanceof Function){
Function f = (Function) term;
Predicate p = f.getFunctionSymbol();
if (p instanceof DatatypePredicate) {
RDFDatatype type = ((DatatypePredicate) p).getReturnedType();
return jdbcTypeMapper.getSQLType... | java | private int getDataType(Term term) {
/*
* TODO: refactor!
*/
if (term instanceof Function){
Function f = (Function) term;
Predicate p = f.getFunctionSymbol();
if (p instanceof DatatypePredicate) {
RDFDatatype type = ((DatatypePredicate) p).getReturnedType();
return jdbcTypeMapper.getSQLType... | [
"private",
"int",
"getDataType",
"(",
"Term",
"term",
")",
"{",
"/*\n\t\t * TODO: refactor!\n\t\t */",
"if",
"(",
"term",
"instanceof",
"Function",
")",
"{",
"Function",
"f",
"=",
"(",
"Function",
")",
"term",
";",
"Predicate",
"p",
"=",
"f",
".",
"getFuncti... | return the SQL data type | [
"return",
"the",
"SQL",
"data",
"type"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L906-L934 |
120,356 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getSelectClauseFragment | private String getSelectClauseFragment(SignatureVariable var,
Term term,
Optional<TermType> termType,
AliasIndex index) {
/*
* Datatype for the main column (to which it is cast).
* Beware, it may defer the RDF datatype (the one of the type column).
*
* Why? Because m... | java | private String getSelectClauseFragment(SignatureVariable var,
Term term,
Optional<TermType> termType,
AliasIndex index) {
/*
* Datatype for the main column (to which it is cast).
* Beware, it may defer the RDF datatype (the one of the type column).
*
* Why? Because m... | [
"private",
"String",
"getSelectClauseFragment",
"(",
"SignatureVariable",
"var",
",",
"Term",
"term",
",",
"Optional",
"<",
"TermType",
">",
"termType",
",",
"AliasIndex",
"index",
")",
"{",
"/*\n\t\t * Datatype for the main column (to which it is cast).\n\t\t * Beware, it ma... | produces the select clause of the sql query for the given CQIE
@return the sql select clause | [
"produces",
"the",
"select",
"clause",
"of",
"the",
"sql",
"query",
"for",
"the",
"given",
"CQIE"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L950-L971 |
120,357 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getTypeColumnForSELECT | private String getTypeColumnForSELECT(Term ht, AliasIndex index, Optional<TermType> optionalTermType) {
if (ht instanceof Variable) {
// Such variable does not hold this information, so we have to look
// at the database metadata.
return index.getTypeColumn((Variable) ht)
.map(QualifiedAttr... | java | private String getTypeColumnForSELECT(Term ht, AliasIndex index, Optional<TermType> optionalTermType) {
if (ht instanceof Variable) {
// Such variable does not hold this information, so we have to look
// at the database metadata.
return index.getTypeColumn((Variable) ht)
.map(QualifiedAttr... | [
"private",
"String",
"getTypeColumnForSELECT",
"(",
"Term",
"ht",
",",
"AliasIndex",
"index",
",",
"Optional",
"<",
"TermType",
">",
"optionalTermType",
")",
"{",
"if",
"(",
"ht",
"instanceof",
"Variable",
")",
"{",
"// Such variable does not hold this information, so... | Infers the type of a projected term.
Note this type may differ from the one used for casting the main column (in some special cases).
This type will appear as the RDF datatype.
@param ht
@param index Used when the term correspond to a column name
@param optionalTermType | [
"Infers",
"the",
"type",
"of",
"a",
"projected",
"term",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L1038-L1056 |
120,358 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/dbschema/BasicDBMetadata.java | BasicDBMetadata.add | protected <T extends RelationDefinition> void add(T td, Map<RelationID, T> schema) {
if (!isStillMutable) {
throw new IllegalStateException("Too late, cannot add a schema");
}
schema.put(td.getID(), td);
if (td.getID().hasSchema()) {
RelationID noSchemaID = td.get... | java | protected <T extends RelationDefinition> void add(T td, Map<RelationID, T> schema) {
if (!isStillMutable) {
throw new IllegalStateException("Too late, cannot add a schema");
}
schema.put(td.getID(), td);
if (td.getID().hasSchema()) {
RelationID noSchemaID = td.get... | [
"protected",
"<",
"T",
"extends",
"RelationDefinition",
">",
"void",
"add",
"(",
"T",
"td",
",",
"Map",
"<",
"RelationID",
",",
"T",
">",
"schema",
")",
"{",
"if",
"(",
"!",
"isStillMutable",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Too... | Inserts a new data definition to this metadata object.
@param td
The data definition. It can be a {@link DatabaseRelationDefinition} or a
{@link ParserViewDefinition} object. | [
"Inserts",
"a",
"new",
"data",
"definition",
"to",
"this",
"metadata",
"object",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/BasicDBMetadata.java#L86-L102 |
120,359 | ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/AbstractTurtleOBDAVisitor.java | AbstractTurtleOBDAVisitor.addToTermsList | private List<ImmutableTerm> addToTermsList(String str) {
ArrayList<ImmutableTerm> terms = new ArrayList<>();
int i, j;
String st;
str = str.substring(1, str.length() - 1);
while (str.contains("{")) {
i = getIndexOfCurlyB(str);
if (i > 0) {
... | java | private List<ImmutableTerm> addToTermsList(String str) {
ArrayList<ImmutableTerm> terms = new ArrayList<>();
int i, j;
String st;
str = str.substring(1, str.length() - 1);
while (str.contains("{")) {
i = getIndexOfCurlyB(str);
if (i > 0) {
... | [
"private",
"List",
"<",
"ImmutableTerm",
">",
"addToTermsList",
"(",
"String",
"str",
")",
"{",
"ArrayList",
"<",
"ImmutableTerm",
">",
"terms",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"i",
",",
"j",
";",
"String",
"st",
";",
"str",
"=",
... | and adds parsed constant literals and template literal to terms list | [
"and",
"adds",
"parsed",
"constant",
"literals",
"and",
"template",
"literal",
"to",
"terms",
"list"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/AbstractTurtleOBDAVisitor.java#L194-L219 |
120,360 | ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/AbstractTurtleOBDAVisitor.java | AbstractTurtleOBDAVisitor.getNestedConcat | private ImmutableTerm getNestedConcat(String str) {
List<ImmutableTerm> terms;
terms = addToTermsList(str);
if (terms.size() == 1) {
return terms.get(0);
}
ImmutableFunctionalTerm f = termFactory.getImmutableFunctionalTerm(ExpressionOperation.CONCAT, terms.get(0), te... | java | private ImmutableTerm getNestedConcat(String str) {
List<ImmutableTerm> terms;
terms = addToTermsList(str);
if (terms.size() == 1) {
return terms.get(0);
}
ImmutableFunctionalTerm f = termFactory.getImmutableFunctionalTerm(ExpressionOperation.CONCAT, terms.get(0), te... | [
"private",
"ImmutableTerm",
"getNestedConcat",
"(",
"String",
"str",
")",
"{",
"List",
"<",
"ImmutableTerm",
">",
"terms",
";",
"terms",
"=",
"addToTermsList",
"(",
"str",
")",
";",
"if",
"(",
"terms",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"retur... | in case of more than two terms need to be concatted | [
"in",
"case",
"of",
"more",
"than",
"two",
"terms",
"need",
"to",
"be",
"concatted"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/AbstractTurtleOBDAVisitor.java#L223-L235 |
120,361 | ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/impl/SQLMappingExtractor.java | SQLMappingExtractor.extractDBMetadata | private RDBMetadata extractDBMetadata(SQLPPMapping ppMapping, Optional<RDBMetadata> optionalDBMetadata,
OBDASpecInput specInput)
throws DBMetadataExtractionException {
boolean isDBMetadataProvided = optionalDBMetadata.isPresent();
/*
* Met... | java | private RDBMetadata extractDBMetadata(SQLPPMapping ppMapping, Optional<RDBMetadata> optionalDBMetadata,
OBDASpecInput specInput)
throws DBMetadataExtractionException {
boolean isDBMetadataProvided = optionalDBMetadata.isPresent();
/*
* Met... | [
"private",
"RDBMetadata",
"extractDBMetadata",
"(",
"SQLPPMapping",
"ppMapping",
",",
"Optional",
"<",
"RDBMetadata",
">",
"optionalDBMetadata",
",",
"OBDASpecInput",
"specInput",
")",
"throws",
"DBMetadataExtractionException",
"{",
"boolean",
"isDBMetadataProvided",
"=",
... | Makes use of the DB connection | [
"Makes",
"use",
"of",
"the",
"DB",
"connection"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/impl/SQLMappingExtractor.java#L131-L155 |
120,362 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java | TypeExtractor.extractCastTypeMap | private ImmutableMap<Predicate,ImmutableList<TermType>> extractCastTypeMap(
Multimap<Predicate, CQIE> ruleIndex, List<Predicate> predicatesInBottomUp,
ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap, DBMetadata metadata) {
// Append-only
Map<Predicate,Immutable... | java | private ImmutableMap<Predicate,ImmutableList<TermType>> extractCastTypeMap(
Multimap<Predicate, CQIE> ruleIndex, List<Predicate> predicatesInBottomUp,
ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap, DBMetadata metadata) {
// Append-only
Map<Predicate,Immutable... | [
"private",
"ImmutableMap",
"<",
"Predicate",
",",
"ImmutableList",
"<",
"TermType",
">",
">",
"extractCastTypeMap",
"(",
"Multimap",
"<",
"Predicate",
",",
"CQIE",
">",
"ruleIndex",
",",
"List",
"<",
"Predicate",
">",
"predicatesInBottomUp",
",",
"ImmutableMap",
... | Infers cast types for each predicate in the bottom up order | [
"Infers",
"cast",
"types",
"for",
"each",
"predicate",
"in",
"the",
"bottom",
"up",
"order"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java#L94-L109 |
120,363 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java | TypeExtractor.inferCastTypes | private ImmutableList<TermType> inferCastTypes(
Predicate predicate, Collection<CQIE> samePredicateRules,
ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap,
Map<Predicate, ImmutableList<TermType>> alreadyKnownCastTypes, DBMetadata metadata) {
if (samePredicat... | java | private ImmutableList<TermType> inferCastTypes(
Predicate predicate, Collection<CQIE> samePredicateRules,
ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap,
Map<Predicate, ImmutableList<TermType>> alreadyKnownCastTypes, DBMetadata metadata) {
if (samePredicat... | [
"private",
"ImmutableList",
"<",
"TermType",
">",
"inferCastTypes",
"(",
"Predicate",
"predicate",
",",
"Collection",
"<",
"CQIE",
">",
"samePredicateRules",
",",
"ImmutableMap",
"<",
"CQIE",
",",
"ImmutableList",
"<",
"Optional",
"<",
"TermType",
">",
">",
">",... | Infers the cast types for one intensional predicate
No side-effect on alreadyKnownCastTypes | [
"Infers",
"the",
"cast",
"types",
"for",
"one",
"intensional",
"predicate"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java#L116-L161 |
120,364 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java | TypeExtractor.collectProposedCastTypes | private ImmutableMultimap<Integer, TermType> collectProposedCastTypes(
Collection<CQIE> samePredicateRules, ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap,
Map<Predicate, ImmutableList<TermType>> alreadyKnownCastTypes) {
ImmutableMultimap.Builder<Integer, TermType> in... | java | private ImmutableMultimap<Integer, TermType> collectProposedCastTypes(
Collection<CQIE> samePredicateRules, ImmutableMap<CQIE, ImmutableList<Optional<TermType>>> termTypeMap,
Map<Predicate, ImmutableList<TermType>> alreadyKnownCastTypes) {
ImmutableMultimap.Builder<Integer, TermType> in... | [
"private",
"ImmutableMultimap",
"<",
"Integer",
",",
"TermType",
">",
"collectProposedCastTypes",
"(",
"Collection",
"<",
"CQIE",
">",
"samePredicateRules",
",",
"ImmutableMap",
"<",
"CQIE",
",",
"ImmutableList",
"<",
"Optional",
"<",
"TermType",
">",
">",
">",
... | Collects the proposed cast types by the definitions of the current predicate | [
"Collects",
"the",
"proposed",
"cast",
"types",
"by",
"the",
"definitions",
"of",
"the",
"current",
"predicate"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java#L166-L201 |
120,365 | ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java | TypeExtractor.getCastTypeFromSubRule | private TermType getCastTypeFromSubRule(
ImmutableTerm term,
ImmutableList<Function> bodyDataAtoms,
Map<Predicate, ImmutableList<TermType>> alreadyKnownCastTypes) {
if (term instanceof Variable) {
Variable variable = (Variable) term;
for (Function bo... | java | private TermType getCastTypeFromSubRule(
ImmutableTerm term,
ImmutableList<Function> bodyDataAtoms,
Map<Predicate, ImmutableList<TermType>> alreadyKnownCastTypes) {
if (term instanceof Variable) {
Variable variable = (Variable) term;
for (Function bo... | [
"private",
"TermType",
"getCastTypeFromSubRule",
"(",
"ImmutableTerm",
"term",
",",
"ImmutableList",
"<",
"Function",
">",
"bodyDataAtoms",
",",
"Map",
"<",
"Predicate",
",",
"ImmutableList",
"<",
"TermType",
">",
">",
"alreadyKnownCastTypes",
")",
"{",
"if",
"(",... | Extracts the cast type of one projected variable
from the body atom that provides it. | [
"Extracts",
"the",
"cast",
"type",
"of",
"one",
"projected",
"variable",
"from",
"the",
"body",
"atom",
"that",
"provides",
"it",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/TypeExtractor.java#L227-L276 |
120,366 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/dbschema/ForeignKeyConstraint.java | ForeignKeyConstraint.of | public static ForeignKeyConstraint of(String name, Attribute attribute, Attribute reference) {
return new Builder((DatabaseRelationDefinition)attribute.getRelation(),
(DatabaseRelationDefinition)reference.getRelation())
.add(attribute, reference).build(name);
} | java | public static ForeignKeyConstraint of(String name, Attribute attribute, Attribute reference) {
return new Builder((DatabaseRelationDefinition)attribute.getRelation(),
(DatabaseRelationDefinition)reference.getRelation())
.add(attribute, reference).build(name);
} | [
"public",
"static",
"ForeignKeyConstraint",
"of",
"(",
"String",
"name",
",",
"Attribute",
"attribute",
",",
"Attribute",
"reference",
")",
"{",
"return",
"new",
"Builder",
"(",
"(",
"DatabaseRelationDefinition",
")",
"attribute",
".",
"getRelation",
"(",
")",
"... | creates a single-attribute foreign key
@param name
@param attribute
@param reference
@return | [
"creates",
"a",
"single",
"-",
"attribute",
"foreign",
"key"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/ForeignKeyConstraint.java#L141-L145 |
120,367 | ontop/ontop | binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/connection/impl/DefaultOntopOWLStatement.java | DefaultOntopOWLStatement.parseQueryString | private InputQuery parseQueryString(String queryString) throws OntopOWLException {
try {
return inputQueryFactory.createSPARQLQuery(queryString);
} catch (OntopInvalidInputQueryException | OntopUnsupportedInputQueryException e) {
throw new OntopOWLException(e);
}
} | java | private InputQuery parseQueryString(String queryString) throws OntopOWLException {
try {
return inputQueryFactory.createSPARQLQuery(queryString);
} catch (OntopInvalidInputQueryException | OntopUnsupportedInputQueryException e) {
throw new OntopOWLException(e);
}
} | [
"private",
"InputQuery",
"parseQueryString",
"(",
"String",
"queryString",
")",
"throws",
"OntopOWLException",
"{",
"try",
"{",
"return",
"inputQueryFactory",
".",
"createSPARQLQuery",
"(",
"queryString",
")",
";",
"}",
"catch",
"(",
"OntopInvalidInputQueryException",
... | In contexts where we don't know the precise type | [
"In",
"contexts",
"where",
"we",
"don",
"t",
"know",
"the",
"precise",
"type"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/connection/impl/DefaultOntopOWLStatement.java#L237-L243 |
120,368 | ontop/ontop | binding/rdf4j/src/main/java/it/unibz/inf/ontop/rdf4j/repository/impl/OntopVirtualRepository.java | OntopVirtualRepository.getConnection | @Override
public RepositoryConnection getConnection() throws RepositoryException {
try {
return new OntopRepositoryConnection(this, getOntopConnection(), inputQueryFactory);
} catch (Exception e) {
logger.error("Error creating repo connection: " + e.getMessage());
throw new RepositoryException(e);
}
} | java | @Override
public RepositoryConnection getConnection() throws RepositoryException {
try {
return new OntopRepositoryConnection(this, getOntopConnection(), inputQueryFactory);
} catch (Exception e) {
logger.error("Error creating repo connection: " + e.getMessage());
throw new RepositoryException(e);
}
} | [
"@",
"Override",
"public",
"RepositoryConnection",
"getConnection",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"return",
"new",
"OntopRepositoryConnection",
"(",
"this",
",",
"getOntopConnection",
"(",
")",
",",
"inputQueryFactory",
")",
";",
"}",
... | Returns a new RepositoryConnection.
(No repository connection sharing for the sake
of thread-safeness) | [
"Returns",
"a",
"new",
"RepositoryConnection",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/binding/rdf4j/src/main/java/it/unibz/inf/ontop/rdf4j/repository/impl/OntopVirtualRepository.java#L63-L71 |
120,369 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModelManager.java | OBDAModelManager.getProperPrefixURI | private static String getProperPrefixURI(String prefixUri) {
if (!prefixUri.endsWith("#")) {
if (!prefixUri.endsWith("/")) {
String defaultSeparator = EntityCreationPreferences.getDefaultSeparator();
if (!prefixUri.endsWith(defaultSeparator)) {
prefixUri += defaultSeparator;
}
}
}
return p... | java | private static String getProperPrefixURI(String prefixUri) {
if (!prefixUri.endsWith("#")) {
if (!prefixUri.endsWith("/")) {
String defaultSeparator = EntityCreationPreferences.getDefaultSeparator();
if (!prefixUri.endsWith(defaultSeparator)) {
prefixUri += defaultSeparator;
}
}
}
return p... | [
"private",
"static",
"String",
"getProperPrefixURI",
"(",
"String",
"prefixUri",
")",
"{",
"if",
"(",
"!",
"prefixUri",
".",
"endsWith",
"(",
"\"#\"",
")",
")",
"{",
"if",
"(",
"!",
"prefixUri",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"String",
"... | A utility method to ensure a proper naming for prefix URI | [
"A",
"utility",
"method",
"to",
"ensure",
"a",
"proper",
"naming",
"for",
"prefix",
"URI"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModelManager.java#L873-L883 |
120,370 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModel.java | OBDAModel.fireMappingDeleted | private void fireMappingDeleted(URI srcuri, String mapping_id) {
for (OBDAMappingListener listener : mappingListeners) {
listener.mappingDeleted(srcuri);
}
} | java | private void fireMappingDeleted(URI srcuri, String mapping_id) {
for (OBDAMappingListener listener : mappingListeners) {
listener.mappingDeleted(srcuri);
}
} | [
"private",
"void",
"fireMappingDeleted",
"(",
"URI",
"srcuri",
",",
"String",
"mapping_id",
")",
"{",
"for",
"(",
"OBDAMappingListener",
"listener",
":",
"mappingListeners",
")",
"{",
"listener",
".",
"mappingDeleted",
"(",
"srcuri",
")",
";",
"}",
"}"
] | Announces to the listeners that a mapping was deleted. | [
"Announces",
"to",
"the",
"listeners",
"that",
"a",
"mapping",
"was",
"deleted",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModel.java#L456-L460 |
120,371 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/datalog/DatalogDependencyGraphGenerator.java | DatalogDependencyGraphGenerator.updateRuleIndexes | private void updateRuleIndexes(CQIE rule) {
Function head = rule.getHead();
ruleIndex.put(head.getFunctionSymbol(), rule);
updateRuleIndexByBodyPredicate(rule);
} | java | private void updateRuleIndexes(CQIE rule) {
Function head = rule.getHead();
ruleIndex.put(head.getFunctionSymbol(), rule);
updateRuleIndexByBodyPredicate(rule);
} | [
"private",
"void",
"updateRuleIndexes",
"(",
"CQIE",
"rule",
")",
"{",
"Function",
"head",
"=",
"rule",
".",
"getHead",
"(",
")",
";",
"ruleIndex",
".",
"put",
"(",
"head",
".",
"getFunctionSymbol",
"(",
")",
",",
"rule",
")",
";",
"updateRuleIndexByBodyPr... | This method takes a rule and populates the ruleIndex field.
@param rule | [
"This",
"method",
"takes",
"a",
"rule",
"and",
"populates",
"the",
"ruleIndex",
"field",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/datalog/DatalogDependencyGraphGenerator.java#L106-L110 |
120,372 | ontop/ontop | core/obda/src/main/java/it/unibz/inf/ontop/spec/mapping/impl/SimplePrefixManager.java | SimplePrefixManager.contains | @Override
public boolean contains(String prefix) {
Set<String> prefixes = prefixToURIMap.keySet();
return prefixes.contains(prefix);
} | java | @Override
public boolean contains(String prefix) {
Set<String> prefixes = prefixToURIMap.keySet();
return prefixes.contains(prefix);
} | [
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"String",
"prefix",
")",
"{",
"Set",
"<",
"String",
">",
"prefixes",
"=",
"prefixToURIMap",
".",
"keySet",
"(",
")",
";",
"return",
"prefixes",
".",
"contains",
"(",
"prefix",
")",
";",
"}"
] | Checks if the prefix manager stores the prefix name.
@param prefix
The prefix name to check. | [
"Checks",
"if",
"the",
"prefix",
"manager",
"stores",
"the",
"prefix",
"name",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/obda/src/main/java/it/unibz/inf/ontop/spec/mapping/impl/SimplePrefixManager.java#L131-L135 |
120,373 | ontop/ontop | engine/reformulation/core/src/main/java/it/unibz/inf/ontop/answering/reformulation/rewriting/impl/Intersection.java | Intersection.intersectWith | public void intersectWith(Intersection<T> arg) {
// if the argument is top then leave all as is
if (arg.elements != null) {
// if arg is empty, the result is empty
if (arg.elements.isEmpty())
elements = Collections.emptySet();
else {
if (elements == null) // we have top, the intersection is sub... | java | public void intersectWith(Intersection<T> arg) {
// if the argument is top then leave all as is
if (arg.elements != null) {
// if arg is empty, the result is empty
if (arg.elements.isEmpty())
elements = Collections.emptySet();
else {
if (elements == null) // we have top, the intersection is sub... | [
"public",
"void",
"intersectWith",
"(",
"Intersection",
"<",
"T",
">",
"arg",
")",
"{",
"// if the argument is top then leave all as is",
"if",
"(",
"arg",
".",
"elements",
"!=",
"null",
")",
"{",
"// if arg is empty, the result is empty",
"if",
"(",
"arg",
".",
"... | modifies by intersecting with another intersection
@param arg another intersection | [
"modifies",
"by",
"intersecting",
"with",
"another",
"intersection"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/core/src/main/java/it/unibz/inf/ontop/answering/reformulation/rewriting/impl/Intersection.java#L113-L127 |
120,374 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/OWLResultSetTableModel.java | OWLResultSetTableModel.getTabularData | public List<String[]> getTabularData() throws OWLException, InterruptedException {
if (tabularData == null) {
tabularData = new ArrayList<>();
String[] columnName = results.getSignature().toArray(new String[numcols]);
// Append the column names
tabularData.add(columnName);
while(this.isFetching){
... | java | public List<String[]> getTabularData() throws OWLException, InterruptedException {
if (tabularData == null) {
tabularData = new ArrayList<>();
String[] columnName = results.getSignature().toArray(new String[numcols]);
// Append the column names
tabularData.add(columnName);
while(this.isFetching){
... | [
"public",
"List",
"<",
"String",
"[",
"]",
">",
"getTabularData",
"(",
")",
"throws",
"OWLException",
",",
"InterruptedException",
"{",
"if",
"(",
"tabularData",
"==",
"null",
")",
"{",
"tabularData",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",... | Fetch all the tuples returned by the result set. | [
"Fetch",
"all",
"the",
"tuples",
"returned",
"by",
"the",
"result",
"set",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/OWLResultSetTableModel.java#L191-L221 |
120,375 | ontop/ontop | client/rdf4j-webapps/config-sql/src/main/java/it/unibz/inf/ontop/rdf4j/repository/OntopRepositoryConfig.java | OntopRepositoryConfig.validateFields | private void validateFields() throws RepositoryConfigException {
try {
/*
* Ontology file
*/
if (owlFile
.filter(f -> !f.exists())
.isPresent()) {
throw new RepositoryConfigException(String.format("The OWL ... | java | private void validateFields() throws RepositoryConfigException {
try {
/*
* Ontology file
*/
if (owlFile
.filter(f -> !f.exists())
.isPresent()) {
throw new RepositoryConfigException(String.format("The OWL ... | [
"private",
"void",
"validateFields",
"(",
")",
"throws",
"RepositoryConfigException",
"{",
"try",
"{",
"/*\n * Ontology file\n */",
"if",
"(",
"owlFile",
".",
"filter",
"(",
"f",
"->",
"!",
"f",
".",
"exists",
"(",
")",
")",
".",
"isPrese... | Checks that the fields are not missing, and that files exist and are accessible. | [
"Checks",
"that",
"the",
"fields",
"are",
"not",
"missing",
"and",
"that",
"files",
"exist",
"and",
"are",
"accessible",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/rdf4j-webapps/config-sql/src/main/java/it/unibz/inf/ontop/rdf4j/repository/OntopRepositoryConfig.java#L111-L178 |
120,376 | ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/union/impl/FlattenUnionExecutorImpl.java | FlattenUnionExecutorImpl.apply | @Override
public NodeCentricOptimizationResults<UnionNode> apply(FlattenUnionProposal proposal, IntermediateQuery query, QueryTreeComponent treeComponent) throws InvalidQueryOptimizationProposalException, EmptyQueryException {
UnionNode focusNode = proposal.getFocusNode();
IntermediateQuery snapSho... | java | @Override
public NodeCentricOptimizationResults<UnionNode> apply(FlattenUnionProposal proposal, IntermediateQuery query, QueryTreeComponent treeComponent) throws InvalidQueryOptimizationProposalException, EmptyQueryException {
UnionNode focusNode = proposal.getFocusNode();
IntermediateQuery snapSho... | [
"@",
"Override",
"public",
"NodeCentricOptimizationResults",
"<",
"UnionNode",
">",
"apply",
"(",
"FlattenUnionProposal",
"proposal",
",",
"IntermediateQuery",
"query",
",",
"QueryTreeComponent",
"treeComponent",
")",
"throws",
"InvalidQueryOptimizationProposalException",
","... | Replace the child subtrees of the focus node | [
"Replace",
"the",
"child",
"subtrees",
"of",
"the",
"focus",
"node"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/union/impl/FlattenUnionExecutorImpl.java#L31-L53 |
120,377 | ontop/ontop | engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/SQLBooleanResultSet.java | SQLBooleanResultSet.getValue | @Override
public boolean getValue() throws OntopConnectionException {
if (hasRead)
throw new IllegalStateException("getValue() can only called once!");
hasRead = true;
try {
return set.next();
} catch (SQLException e) {
throw new OntopConnectionExc... | java | @Override
public boolean getValue() throws OntopConnectionException {
if (hasRead)
throw new IllegalStateException("getValue() can only called once!");
hasRead = true;
try {
return set.next();
} catch (SQLException e) {
throw new OntopConnectionExc... | [
"@",
"Override",
"public",
"boolean",
"getValue",
"(",
")",
"throws",
"OntopConnectionException",
"{",
"if",
"(",
"hasRead",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"getValue() can only called once!\"",
")",
";",
"hasRead",
"=",
"true",
";",
"try",
"{... | Returns true if there is at least one result | [
"Returns",
"true",
"if",
"there",
"is",
"at",
"least",
"one",
"result"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/SQLBooleanResultSet.java#L53-L63 |
120,378 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/ConstructionNodeImpl.java | ConstructionNodeImpl.validateNode | private void validateNode() throws InvalidQueryNodeException {
ImmutableSet<Variable> substitutionDomain = substitution.getDomain();
// The substitution domain must be a subset of the projectedVariables
if (!projectedVariables.containsAll(substitutionDomain)) {
throw new InvalidQuer... | java | private void validateNode() throws InvalidQueryNodeException {
ImmutableSet<Variable> substitutionDomain = substitution.getDomain();
// The substitution domain must be a subset of the projectedVariables
if (!projectedVariables.containsAll(substitutionDomain)) {
throw new InvalidQuer... | [
"private",
"void",
"validateNode",
"(",
")",
"throws",
"InvalidQueryNodeException",
"{",
"ImmutableSet",
"<",
"Variable",
">",
"substitutionDomain",
"=",
"substitution",
".",
"getDomain",
"(",
")",
";",
"// The substitution domain must be a subset of the projectedVariables",
... | Validates the node independently of its child | [
"Validates",
"the",
"node",
"independently",
"of",
"its",
"child"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/ConstructionNodeImpl.java#L98-L124 |
120,379 | ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java | MappingDataTypeCompletion.insertVariableDataTyping | private void insertVariableDataTyping(Term term, Function atom, int position,
Map<String, List<IndexedPosition>> termOccurenceIndex) throws UnknownDatatypeException {
if (term instanceof Function) {
Function function = (Function) term;
Predica... | java | private void insertVariableDataTyping(Term term, Function atom, int position,
Map<String, List<IndexedPosition>> termOccurenceIndex) throws UnknownDatatypeException {
if (term instanceof Function) {
Function function = (Function) term;
Predica... | [
"private",
"void",
"insertVariableDataTyping",
"(",
"Term",
"term",
",",
"Function",
"atom",
",",
"int",
"position",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"IndexedPosition",
">",
">",
"termOccurenceIndex",
")",
"throws",
"UnknownDatatypeException",
"{",
"... | This method wraps the variable that holds data property values with a data type predicate.
It will replace the variable with a new function symbol and update the rule atom.
However, if the users already defined the data-type in the mapping, this method simply accepts the function symbol. | [
"This",
"method",
"wraps",
"the",
"variable",
"that",
"holds",
"data",
"property",
"values",
"with",
"a",
"data",
"type",
"predicate",
".",
"It",
"will",
"replace",
"the",
"variable",
"with",
"a",
"new",
"function",
"symbol",
"and",
"update",
"the",
"rule",
... | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java#L104-L140 |
120,380 | ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java | MappingDataTypeCompletion.insertOperationDatatyping | private void insertOperationDatatyping(Term term, Function atom, int position) throws UnknownDatatypeException {
ImmutableTerm immutableTerm = immutabilityTools.convertIntoImmutableTerm(term);
if (immutableTerm instanceof ImmutableFunctionalTerm) {
ImmutableFunctionalTerm castTerm = (Immut... | java | private void insertOperationDatatyping(Term term, Function atom, int position) throws UnknownDatatypeException {
ImmutableTerm immutableTerm = immutabilityTools.convertIntoImmutableTerm(term);
if (immutableTerm instanceof ImmutableFunctionalTerm) {
ImmutableFunctionalTerm castTerm = (Immut... | [
"private",
"void",
"insertOperationDatatyping",
"(",
"Term",
"term",
",",
"Function",
"atom",
",",
"int",
"position",
")",
"throws",
"UnknownDatatypeException",
"{",
"ImmutableTerm",
"immutableTerm",
"=",
"immutabilityTools",
".",
"convertIntoImmutableTerm",
"(",
"term"... | Following r2rml standard we do not infer the datatype for operation but we return the default value string | [
"Following",
"r2rml",
"standard",
"we",
"do",
"not",
"infer",
"the",
"datatype",
"for",
"operation",
"but",
"we",
"return",
"the",
"default",
"value",
"string"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java#L145-L185 |
120,381 | ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java | MappingDataTypeCompletion.getDataType | private RDFDatatype getDataType(Map<String, List<IndexedPosition>> termOccurenceIndex, Variable variable) throws UnknownDatatypeException {
List<IndexedPosition> list = termOccurenceIndex.get(variable.getName());
if (list == null)
throw new UnboundTargetVariableException(variable);
... | java | private RDFDatatype getDataType(Map<String, List<IndexedPosition>> termOccurenceIndex, Variable variable) throws UnknownDatatypeException {
List<IndexedPosition> list = termOccurenceIndex.get(variable.getName());
if (list == null)
throw new UnboundTargetVariableException(variable);
... | [
"private",
"RDFDatatype",
"getDataType",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"IndexedPosition",
">",
">",
"termOccurenceIndex",
",",
"Variable",
"variable",
")",
"throws",
"UnknownDatatypeException",
"{",
"List",
"<",
"IndexedPosition",
">",
"list",
"=",
... | returns COL_TYPE for one of the datatype ids
@param termOccurenceIndex
@param variable
@return | [
"returns",
"COL_TYPE",
"for",
"one",
"of",
"the",
"datatype",
"ids"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java#L209-L248 |
120,382 | ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/iq/tools/impl/UnionBasedQueryMergerImpl.java | UnionBasedQueryMergerImpl.computeRenamingSubstitution | private Optional<InjectiveVar2VarSubstitution> computeRenamingSubstitution(
DistinctVariableOnlyDataAtom sourceProjectionAtom,
DistinctVariableOnlyDataAtom targetProjectionAtom) {
int arity = sourceProjectionAtom.getEffectiveArity();
if (!sourceProjectionAtom.getPredicate().equ... | java | private Optional<InjectiveVar2VarSubstitution> computeRenamingSubstitution(
DistinctVariableOnlyDataAtom sourceProjectionAtom,
DistinctVariableOnlyDataAtom targetProjectionAtom) {
int arity = sourceProjectionAtom.getEffectiveArity();
if (!sourceProjectionAtom.getPredicate().equ... | [
"private",
"Optional",
"<",
"InjectiveVar2VarSubstitution",
">",
"computeRenamingSubstitution",
"(",
"DistinctVariableOnlyDataAtom",
"sourceProjectionAtom",
",",
"DistinctVariableOnlyDataAtom",
"targetProjectionAtom",
")",
"{",
"int",
"arity",
"=",
"sourceProjectionAtom",
".",
... | When such substitution DO NOT EXIST, returns an EMPTY OPTIONAL.
When NO renaming is NEEDED returns an EMPTY SUBSTITUTION. | [
"When",
"such",
"substitution",
"DO",
"NOT",
"EXIST",
"returns",
"an",
"EMPTY",
"OPTIONAL",
".",
"When",
"NO",
"renaming",
"is",
"NEEDED",
"returns",
"an",
"EMPTY",
"SUBSTITUTION",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/iq/tools/impl/UnionBasedQueryMergerImpl.java#L122-L142 |
120,383 | ontop/ontop | engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/connection/impl/SQLQuestStatement.java | SQLQuestStatement.getTupleCount | @Override
public int getTupleCount(InputQuery inputQuery) throws OntopReformulationException, OntopQueryEvaluationException {
SQLExecutableQuery targetQuery = checkAndConvertTargetQuery(getExecutableQuery(inputQuery));
String sql = targetQuery.getSQL();
String newsql = "SELECT count(*) FROM ... | java | @Override
public int getTupleCount(InputQuery inputQuery) throws OntopReformulationException, OntopQueryEvaluationException {
SQLExecutableQuery targetQuery = checkAndConvertTargetQuery(getExecutableQuery(inputQuery));
String sql = targetQuery.getSQL();
String newsql = "SELECT count(*) FROM ... | [
"@",
"Override",
"public",
"int",
"getTupleCount",
"(",
"InputQuery",
"inputQuery",
")",
"throws",
"OntopReformulationException",
",",
"OntopQueryEvaluationException",
"{",
"SQLExecutableQuery",
"targetQuery",
"=",
"checkAndConvertTargetQuery",
"(",
"getExecutableQuery",
"(",... | Returns the number of tuples returned by the query | [
"Returns",
"the",
"number",
"of",
"tuples",
"returned",
"by",
"the",
"query"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/connection/impl/SQLQuestStatement.java#L135-L157 |
120,384 | ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/datalog/EQNormalizer.java | EQNormalizer.nestedEQSubstitutions | private void nestedEQSubstitutions(Function atom, Substitution mgu) {
List<Term> terms = atom.getTerms();
for (int i = 0; i < terms.size(); i++) {
Term t = terms.get(i);
if (t instanceof Function) {
Function t2 = (Function) t;
substitutionUt... | java | private void nestedEQSubstitutions(Function atom, Substitution mgu) {
List<Term> terms = atom.getTerms();
for (int i = 0; i < terms.size(); i++) {
Term t = terms.get(i);
if (t instanceof Function) {
Function t2 = (Function) t;
substitutionUt... | [
"private",
"void",
"nestedEQSubstitutions",
"(",
"Function",
"atom",
",",
"Substitution",
"mgu",
")",
"{",
"List",
"<",
"Term",
">",
"terms",
"=",
"atom",
".",
"getTerms",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"terms",
".",
... | We search for equalities in conjunctions. This recursive methods explore AND functions
and removes EQ functions, substituting the values using the class
@param atom the atom that can contain equalities
@param mgu mapping between a variable and a term | [
"We",
"search",
"for",
"equalities",
"in",
"conjunctions",
".",
"This",
"recursive",
"methods",
"explore",
"AND",
"functions",
"and",
"removes",
"EQ",
"functions",
"substituting",
"the",
"values",
"using",
"the",
"class"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/datalog/EQNormalizer.java#L88-L127 |
120,385 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/InjectiveVar2VarSubstitutionImpl.java | InjectiveVar2VarSubstitutionImpl.applyToSubstitution | @Override
public <T extends ImmutableTerm> Optional<ImmutableSubstitution<T>> applyToSubstitution(
ImmutableSubstitution<T> substitution) {
return Optional.of(applyRenaming(substitution));
} | java | @Override
public <T extends ImmutableTerm> Optional<ImmutableSubstitution<T>> applyToSubstitution(
ImmutableSubstitution<T> substitution) {
return Optional.of(applyRenaming(substitution));
} | [
"@",
"Override",
"public",
"<",
"T",
"extends",
"ImmutableTerm",
">",
"Optional",
"<",
"ImmutableSubstitution",
"<",
"T",
">",
">",
"applyToSubstitution",
"(",
"ImmutableSubstitution",
"<",
"T",
">",
"substitution",
")",
"{",
"return",
"Optional",
".",
"of",
"... | More efficient implementation | [
"More",
"efficient",
"implementation"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/InjectiveVar2VarSubstitutionImpl.java#L83-L87 |
120,386 | ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java | RAExpression.getJoinOnFilter | private static ImmutableList<Function> getJoinOnFilter(RAExpressionAttributes re1,
RAExpressionAttributes re2,
ImmutableSet<QuotedID> using,
Te... | java | private static ImmutableList<Function> getJoinOnFilter(RAExpressionAttributes re1,
RAExpressionAttributes re2,
ImmutableSet<QuotedID> using,
Te... | [
"private",
"static",
"ImmutableList",
"<",
"Function",
">",
"getJoinOnFilter",
"(",
"RAExpressionAttributes",
"re1",
",",
"RAExpressionAttributes",
"re2",
",",
"ImmutableSet",
"<",
"QuotedID",
">",
"using",
",",
"TermFactory",
"termFactory",
")",
"{",
"return",
"usi... | internal implementation of JOIN USING and NATURAL JOIN
@param re1 a {@link RAExpressionAttributes}
@param re2 a {@link RAExpressionAttributes}
@param using a {@link ImmutableSet}<{@link QuotedID}>
@return a {@Link ImmutableList}<{@link Function}> | [
"internal",
"implementation",
"of",
"JOIN",
"USING",
"and",
"NATURAL",
"JOIN"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java#L150-L168 |
120,387 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/model/term/impl/ImmutabilityTools.java | ImmutabilityTools.convertIntoImmutableTerm | public ImmutableTerm convertIntoImmutableTerm(Term term) {
if (term instanceof Function) {
if (term instanceof Expression) {
Expression expression = (Expression) term;
return termFactory.getImmutableExpression(expression);
} else {
Function... | java | public ImmutableTerm convertIntoImmutableTerm(Term term) {
if (term instanceof Function) {
if (term instanceof Expression) {
Expression expression = (Expression) term;
return termFactory.getImmutableExpression(expression);
} else {
Function... | [
"public",
"ImmutableTerm",
"convertIntoImmutableTerm",
"(",
"Term",
"term",
")",
"{",
"if",
"(",
"term",
"instanceof",
"Function",
")",
"{",
"if",
"(",
"term",
"instanceof",
"Expression",
")",
"{",
"Expression",
"expression",
"=",
"(",
"Expression",
")",
"term... | In case the term is functional, creates an immutable copy of it. | [
"In",
"case",
"the",
"term",
"is",
"functional",
"creates",
"an",
"immutable",
"copy",
"of",
"it",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/model/term/impl/ImmutabilityTools.java#L39-L60 |
120,388 | ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/model/term/impl/ImmutabilityTools.java | ImmutabilityTools.convertToMutableBooleanExpression | public Expression convertToMutableBooleanExpression(ImmutableExpression booleanExpression) {
OperationPredicate pred = booleanExpression.getFunctionSymbol();
return termFactory.getExpression(pred, convertToMutableTerms(booleanExpression.getTerms()));
} | java | public Expression convertToMutableBooleanExpression(ImmutableExpression booleanExpression) {
OperationPredicate pred = booleanExpression.getFunctionSymbol();
return termFactory.getExpression(pred, convertToMutableTerms(booleanExpression.getTerms()));
} | [
"public",
"Expression",
"convertToMutableBooleanExpression",
"(",
"ImmutableExpression",
"booleanExpression",
")",
"{",
"OperationPredicate",
"pred",
"=",
"booleanExpression",
".",
"getFunctionSymbol",
"(",
")",
";",
"return",
"termFactory",
".",
"getExpression",
"(",
"pr... | This method takes a immutable boolean term and convert it into an old mutable boolean function. | [
"This",
"method",
"takes",
"a",
"immutable",
"boolean",
"term",
"and",
"convert",
"it",
"into",
"an",
"old",
"mutable",
"boolean",
"function",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/model/term/impl/ImmutabilityTools.java#L132-L135 |
120,389 | ontop/ontop | db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java | RDBMetadataExtractionTools.getTableList | private static List<RelationID> getTableList(String defaultTableSchema, Set<RelationID> realTables, QuotedIDFactory idfac) throws SQLException {
List<RelationID> fks = new LinkedList<>();
for (RelationID table : realTables) {
// defaultTableSchema is non-empty only for Oracle and DUAL is a special Oracle table
... | java | private static List<RelationID> getTableList(String defaultTableSchema, Set<RelationID> realTables, QuotedIDFactory idfac) throws SQLException {
List<RelationID> fks = new LinkedList<>();
for (RelationID table : realTables) {
// defaultTableSchema is non-empty only for Oracle and DUAL is a special Oracle table
... | [
"private",
"static",
"List",
"<",
"RelationID",
">",
"getTableList",
"(",
"String",
"defaultTableSchema",
",",
"Set",
"<",
"RelationID",
">",
"realTables",
",",
"QuotedIDFactory",
"idfac",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"RelationID",
">",
"fks"... | Retrieve the normalized list of tables from a given list of RelationIDs | [
"Retrieve",
"the",
"normalized",
"list",
"of",
"tables",
"from",
"a",
"given",
"list",
"of",
"RelationIDs"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java#L308-L321 |
120,390 | ontop/ontop | db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java | RDBMetadataExtractionTools.getTableList | private static List<RelationID> getTableList(Connection conn, RelationListProvider relationListProvider, QuotedIDFactory idfac) throws SQLException {
// Obtain the relational objects (i.e., tables and views)
List<RelationID> relationIds = new LinkedList<>();
try (Statement stmt = conn.createStatement();
Resu... | java | private static List<RelationID> getTableList(Connection conn, RelationListProvider relationListProvider, QuotedIDFactory idfac) throws SQLException {
// Obtain the relational objects (i.e., tables and views)
List<RelationID> relationIds = new LinkedList<>();
try (Statement stmt = conn.createStatement();
Resu... | [
"private",
"static",
"List",
"<",
"RelationID",
">",
"getTableList",
"(",
"Connection",
"conn",
",",
"RelationListProvider",
"relationListProvider",
",",
"QuotedIDFactory",
"idfac",
")",
"throws",
"SQLException",
"{",
"// Obtain the relational objects (i.e., tables and views)... | Retrieve metadata for a specific database engine | [
"Retrieve",
"metadata",
"for",
"a",
"specific",
"database",
"engine"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java#L348-L358 |
120,391 | ontop/ontop | db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java | RDBMetadataExtractionTools.getPrimaryKey | private static void getPrimaryKey(DatabaseMetaData md, DatabaseRelationDefinition relation, QuotedIDFactory idfac) throws SQLException {
RelationID id = relation.getID();
// Retrieves a description of the given table's primary key columns. They are ordered by COLUMN_NAME (sic!)
try (ResultSet rs = md.getPrimaryKe... | java | private static void getPrimaryKey(DatabaseMetaData md, DatabaseRelationDefinition relation, QuotedIDFactory idfac) throws SQLException {
RelationID id = relation.getID();
// Retrieves a description of the given table's primary key columns. They are ordered by COLUMN_NAME (sic!)
try (ResultSet rs = md.getPrimaryKe... | [
"private",
"static",
"void",
"getPrimaryKey",
"(",
"DatabaseMetaData",
"md",
",",
"DatabaseRelationDefinition",
"relation",
",",
"QuotedIDFactory",
"idfac",
")",
"throws",
"SQLException",
"{",
"RelationID",
"id",
"=",
"relation",
".",
"getID",
"(",
")",
";",
"// R... | Retrieves the primary key for the table | [
"Retrieves",
"the",
"primary",
"key",
"for",
"the",
"table"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java#L564-L576 |
120,392 | ontop/ontop | db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java | RDBMetadataExtractionTools.getForeignKeys | private static void getForeignKeys(DatabaseMetaData md, DatabaseRelationDefinition relation, DBMetadata metadata) throws SQLException {
QuotedIDFactory idfac = metadata.getQuotedIDFactory();
RelationID relationId = relation.getID();
try (ResultSet rs = md.getImportedKeys(null, relationId.getSchemaName(), relati... | java | private static void getForeignKeys(DatabaseMetaData md, DatabaseRelationDefinition relation, DBMetadata metadata) throws SQLException {
QuotedIDFactory idfac = metadata.getQuotedIDFactory();
RelationID relationId = relation.getID();
try (ResultSet rs = md.getImportedKeys(null, relationId.getSchemaName(), relati... | [
"private",
"static",
"void",
"getForeignKeys",
"(",
"DatabaseMetaData",
"md",
",",
"DatabaseRelationDefinition",
"relation",
",",
"DBMetadata",
"metadata",
")",
"throws",
"SQLException",
"{",
"QuotedIDFactory",
"idfac",
"=",
"metadata",
".",
"getQuotedIDFactory",
"(",
... | Retrieves the foreign keys for the table | [
"Retrieves",
"the",
"foreign",
"keys",
"for",
"the",
"table"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/RDBMetadataExtractionTools.java#L679-L692 |
120,393 | ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/join/SelfJoinLikeExecutor.java | SelfJoinLikeExecutor.proposeForGroupingMap | protected PredicateLevelProposal proposeForGroupingMap(
ImmutableMultimap<ImmutableList<VariableOrGroundTerm>, ExtensionalDataNode> groupingMap)
throws AtomUnificationException {
ImmutableCollection<Collection<ExtensionalDataNode>> dataNodeGroups = groupingMap.asMap().values();
try {
... | java | protected PredicateLevelProposal proposeForGroupingMap(
ImmutableMultimap<ImmutableList<VariableOrGroundTerm>, ExtensionalDataNode> groupingMap)
throws AtomUnificationException {
ImmutableCollection<Collection<ExtensionalDataNode>> dataNodeGroups = groupingMap.asMap().values();
try {
... | [
"protected",
"PredicateLevelProposal",
"proposeForGroupingMap",
"(",
"ImmutableMultimap",
"<",
"ImmutableList",
"<",
"VariableOrGroundTerm",
">",
",",
"ExtensionalDataNode",
">",
"groupingMap",
")",
"throws",
"AtomUnificationException",
"{",
"ImmutableCollection",
"<",
"Colle... | groupingMap groups data nodes that are being joined on the unique constraints
creates proposal to unify redundant nodes | [
"groupingMap",
"groups",
"data",
"nodes",
"that",
"are",
"being",
"joined",
"on",
"the",
"unique",
"constraints"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/join/SelfJoinLikeExecutor.java#L186-L231 |
120,394 | ontop/ontop | core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/join/SelfJoinLikeExecutor.java | SelfJoinLikeExecutor.propagateSubstitution | private static <T extends QueryNode> NodeCentricOptimizationResults<T> propagateSubstitution(
IntermediateQuery query,
Optional<ImmutableSubstitution<VariableOrGroundTerm>> optionalSubstitution,
T topNode) throws EmptyQueryException {
if (optionalSubstitution.isPresent()) {
... | java | private static <T extends QueryNode> NodeCentricOptimizationResults<T> propagateSubstitution(
IntermediateQuery query,
Optional<ImmutableSubstitution<VariableOrGroundTerm>> optionalSubstitution,
T topNode) throws EmptyQueryException {
if (optionalSubstitution.isPresent()) {
... | [
"private",
"static",
"<",
"T",
"extends",
"QueryNode",
">",
"NodeCentricOptimizationResults",
"<",
"T",
">",
"propagateSubstitution",
"(",
"IntermediateQuery",
"query",
",",
"Optional",
"<",
"ImmutableSubstitution",
"<",
"VariableOrGroundTerm",
">",
">",
"optionalSubsti... | Applies the substitution from the topNode.
NB: the topNode can be a JoinLikeNode, a replacing FilterNode or the replacing child | [
"Applies",
"the",
"substitution",
"from",
"the",
"topNode",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/optimization/src/main/java/it/unibz/inf/ontop/iq/executor/join/SelfJoinLikeExecutor.java#L442-L463 |
120,395 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/views/QueryInterfaceView.java | QueryInterfaceView.removeResultTable | private synchronized void removeResultTable(){
OWLResultSetTableModel tm = getTableModel();
if (tm != null){
tm.close();
}
resultTablePanel.setTableModel(new DefaultTableModel());
} | java | private synchronized void removeResultTable(){
OWLResultSetTableModel tm = getTableModel();
if (tm != null){
tm.close();
}
resultTablePanel.setTableModel(new DefaultTableModel());
} | [
"private",
"synchronized",
"void",
"removeResultTable",
"(",
")",
"{",
"OWLResultSetTableModel",
"tm",
"=",
"getTableModel",
"(",
")",
";",
"if",
"(",
"tm",
"!=",
"null",
")",
"{",
"tm",
".",
"close",
"(",
")",
";",
"}",
"resultTablePanel",
".",
"setTableM... | removes the result table.
Could be called at data query execution, or at cancelling
Not necessary when replacing with a new result, just to remove old
results that are outdated | [
"removes",
"the",
"result",
"table",
".",
"Could",
"be",
"called",
"at",
"data",
"query",
"execution",
"or",
"at",
"cancelling",
"Not",
"necessary",
"when",
"replacing",
"with",
"a",
"new",
"result",
"just",
"to",
"remove",
"old",
"results",
"that",
"are",
... | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/views/QueryInterfaceView.java#L470-L476 |
120,396 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/views/QueryInterfaceView.java | QueryInterfaceView.setupListeners | public void setupListeners() {
// Getting the list of views
QueryInterfaceViewsList queryInterfaceViews = (QueryInterfaceViewsList) this.getOWLEditorKit().get(QueryInterfaceViewsList.class.getName());
if ((queryInterfaceViews == null)) {
queryInterfaceViews = new QueryInterfaceViewsList();
getOWLEditorKit(... | java | public void setupListeners() {
// Getting the list of views
QueryInterfaceViewsList queryInterfaceViews = (QueryInterfaceViewsList) this.getOWLEditorKit().get(QueryInterfaceViewsList.class.getName());
if ((queryInterfaceViews == null)) {
queryInterfaceViews = new QueryInterfaceViewsList();
getOWLEditorKit(... | [
"public",
"void",
"setupListeners",
"(",
")",
"{",
"// Getting the list of views",
"QueryInterfaceViewsList",
"queryInterfaceViews",
"=",
"(",
"QueryInterfaceViewsList",
")",
"this",
".",
"getOWLEditorKit",
"(",
")",
".",
"get",
"(",
"QueryInterfaceViewsList",
".",
"cla... | On creation of a new view, we register it globally and make sure that its selector is listened
by all other instances of query view in this editor kit. Also, we make this new instance listen
to the selection of all other query selectors in the views. | [
"On",
"creation",
"of",
"a",
"new",
"view",
"we",
"register",
"it",
"globally",
"and",
"make",
"sure",
"that",
"its",
"selector",
"is",
"listened",
"by",
"all",
"other",
"instances",
"of",
"query",
"view",
"in",
"this",
"editor",
"kit",
".",
"Also",
"we"... | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/views/QueryInterfaceView.java#L531-L550 |
120,397 | ontop/ontop | engine/system/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/DefaultSimpleGraphResultSet.java | DefaultSimpleGraphResultSet.processResults | private List<Assertion> processResults(OntopBindingSet bindingSet)
throws OntopResultConversionException, OntopConnectionException {
List<Assertion> tripleAssertions = new ArrayList<>();
ABoxAssertionSupplier builder = OntologyBuilderImpl.assertionSupplier(rdfFactory);
for (Project... | java | private List<Assertion> processResults(OntopBindingSet bindingSet)
throws OntopResultConversionException, OntopConnectionException {
List<Assertion> tripleAssertions = new ArrayList<>();
ABoxAssertionSupplier builder = OntologyBuilderImpl.assertionSupplier(rdfFactory);
for (Project... | [
"private",
"List",
"<",
"Assertion",
">",
"processResults",
"(",
"OntopBindingSet",
"bindingSet",
")",
"throws",
"OntopResultConversionException",
",",
"OntopConnectionException",
"{",
"List",
"<",
"Assertion",
">",
"tripleAssertions",
"=",
"new",
"ArrayList",
"<>",
"... | The method to actually process the current result set Row.
Construct a list of assertions from the current result set row.
In case of describe it is called to process and store all
the results from a resultset.
In case of construct it is called upon next, to process
the only current result set. | [
"The",
"method",
"to",
"actually",
"process",
"the",
"current",
"result",
"set",
"Row",
".",
"Construct",
"a",
"list",
"of",
"assertions",
"from",
"the",
"current",
"result",
"set",
"row",
".",
"In",
"case",
"of",
"describe",
"it",
"is",
"called",
"to",
... | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/system/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/DefaultSimpleGraphResultSet.java#L106-L153 |
120,398 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OntopProtegeReasoner.java | OntopProtegeReasoner.getEmptyEntitiesChecker | public QuestOWLEmptyEntitiesChecker getEmptyEntitiesChecker() throws Exception {
OWLOntology rootOntology = getRootOntology();
Ontology mergeOntology = owlapiTranslator.translateAndClassify(rootOntology);
ClassifiedTBox tBox = mergeOntology.tbox();
return new QuestOWLEmptyEntitiesChecke... | java | public QuestOWLEmptyEntitiesChecker getEmptyEntitiesChecker() throws Exception {
OWLOntology rootOntology = getRootOntology();
Ontology mergeOntology = owlapiTranslator.translateAndClassify(rootOntology);
ClassifiedTBox tBox = mergeOntology.tbox();
return new QuestOWLEmptyEntitiesChecke... | [
"public",
"QuestOWLEmptyEntitiesChecker",
"getEmptyEntitiesChecker",
"(",
")",
"throws",
"Exception",
"{",
"OWLOntology",
"rootOntology",
"=",
"getRootOntology",
"(",
")",
";",
"Ontology",
"mergeOntology",
"=",
"owlapiTranslator",
".",
"translateAndClassify",
"(",
"rootOn... | Methods to get the empty concepts and roles in the ontology using the given mappings.
It generates SPARQL queries to check for entities.
@return QuestOWLEmptyEntitiesChecker class to get empty concepts and roles
@throws Exception | [
"Methods",
"to",
"get",
"the",
"empty",
"concepts",
"and",
"roles",
"in",
"the",
"ontology",
"using",
"the",
"given",
"mappings",
".",
"It",
"generates",
"SPARQL",
"queries",
"to",
"check",
"for",
"entities",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OntopProtegeReasoner.java#L328-L334 |
120,399 | ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OntopProtegeReasoner.java | OntopProtegeReasoner.replaceConnection | public OWLConnection replaceConnection() throws OntopConnectionException {
OWLConnection oldconn = this.owlConnection;
owlConnection = reasoner.getConnection();
return oldconn;
} | java | public OWLConnection replaceConnection() throws OntopConnectionException {
OWLConnection oldconn = this.owlConnection;
owlConnection = reasoner.getConnection();
return oldconn;
} | [
"public",
"OWLConnection",
"replaceConnection",
"(",
")",
"throws",
"OntopConnectionException",
"{",
"OWLConnection",
"oldconn",
"=",
"this",
".",
"owlConnection",
";",
"owlConnection",
"=",
"reasoner",
".",
"getConnection",
"(",
")",
";",
"return",
"oldconn",
";",
... | Replaces the owl connection with a new one
Called when the user cancels a query. Easier to get a new connection, than waiting for the cancel
@return The old connection: The caller must close this connection | [
"Replaces",
"the",
"owl",
"connection",
"with",
"a",
"new",
"one",
"Called",
"when",
"the",
"user",
"cancels",
"a",
"query",
".",
"Easier",
"to",
"get",
"a",
"new",
"connection",
"than",
"waiting",
"for",
"the",
"cancel"
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OntopProtegeReasoner.java#L341-L345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.